Skip to content

Commit 124b0a2

Browse files
committed
Rename ci to test workflow. Add publish workflow.
1 parent ca915ff commit 124b0a2

File tree

3 files changed

+51
-2
lines changed

3 files changed

+51
-2
lines changed

.github/workflows/publish.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
repository:
7+
description: "Target repository (pypi or test)"
8+
required: true
9+
default: "pypi"
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
# Checkout the repository
17+
- name: Checkout Code
18+
uses: actions/checkout@v3
19+
20+
# Set up Python environment
21+
- name: Set up Python
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: 3.9
25+
26+
# Install build and twine
27+
- name: Install Build Tools
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install build twine
31+
32+
# Build the package
33+
- name: Build the Package
34+
run: python -m build
35+
36+
- name: Publish to Test PyPI
37+
if: github.event.inputs.repository == 'test'
38+
env:
39+
TWINE_USERNAME: __token__
40+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
41+
run: twine upload --repository-url https://test.pypi.org/legacy/ dist/*
42+
43+
- name: Publish to Regular PyPI
44+
if: github.event.inputs.repository == 'pypi'
45+
env:
46+
TWINE_USERNAME: __token__
47+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
48+
run: twine upload dist/*
49+
File renamed without changes.

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "judge0-py"
3-
version = "0.0.1-dev"
3+
version = "0.0.1-rc1"
44
description = "Python client library for Judge0."
55
readme = "README.md"
66
requires-python = ">=3.9"
@@ -29,7 +29,7 @@ classifiers = [
2929
dependencies = []
3030

3131
[build-system]
32-
requires = ["setuptools"]
32+
requires = ["setuptools>=70.0"]
3333
build-backend = "setuptools.build_meta"
3434

3535
[project.urls]

0 commit comments

Comments
 (0)