Skip to content

Commit 29bb39a

Browse files
author
Sam Partee
authored
Initial Release (#42)
Change CD to use manual deployment for test and official releases.
1 parent 4877f8b commit 29bb39a

File tree

5 files changed

+277
-263
lines changed

5 files changed

+277
-263
lines changed

.github/workflows/publish.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
name: deploy-release
22

33
on:
4-
pull_request:
5-
types: [closed]
6-
branches: [main]
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version of this deployment'
8+
required: true
79

810
jobs:
911
build_release:
10-
if: |
11-
${{ github.event.pull_request.merged == true }}
12-
&& ${{ contains(github.event.pull_request.labels.*.name, 'release') }}
1312
name: Build Release
1413
runs-on: ubuntu-latest
1514
steps:
@@ -24,10 +23,6 @@ jobs:
2423
python -m pip install --upgrade pip
2524
python -m pip install setuptools wheel
2625
27-
- name: check-version
28-
run: |
29-
echo "VERSION=$(python setup.py --version)" >> $GITHUB_OUTPUT
30-
3126
- name: create python package
3227
run: python setup.py sdist bdist_wheel
3328

@@ -38,12 +33,11 @@ jobs:
3833
token: ${{ secrets.GITHUB_TOKEN }}
3934
draft: false
4035
generateReleaseNotes: true
41-
tag: v${{ steps.check-version.outputs.VERSION }}
36+
tag: ${{ github.event.inputs.version }}
4237
commit: main
4338

4439
- name: deploy
4540
uses: pypa/gh-action-pypi-publish@release/v1
4641
with:
4742
user: __token__
48-
password: ${{ secrets.PYPI }}
49-
repository_url: https://test.pypi.org/legacy/
43+
password: ${{ secrets.PYPI }}

.github/workflows/test-publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: deploy-test-release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version of this deployment'
8+
required: true
9+
10+
jobs:
11+
build_release:
12+
name: Build Release
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Set up Python 3.10
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: "3.10"
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
python -m pip install setuptools wheel
25+
26+
- name: create python package
27+
run: python setup.py sdist bdist_wheel
28+
29+
- name: Create Release
30+
uses: ncipollo/release-action@v1
31+
with:
32+
artifacts: "dist/*"
33+
token: ${{ secrets.GITHUB_TOKEN }}
34+
draft: false
35+
generateReleaseNotes: true
36+
tag: ${{ github.event.inputs.version }}
37+
commit: main
38+
39+
- name: deploy
40+
uses: pypa/gh-action-pypi-publish@release/v1
41+
with:
42+
user: __token__
43+
password: ${{ secrets.PYPI }}
44+
repository_url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)