-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (51 loc) · 1.75 KB
/
package_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Release the Next Version of the Package and Documentation
on:
release:
types: [published]
jobs:
release-version:
runs-on: ubuntu-latest
steps:
- id: parse-version
name: Parse release version
run: |
echo "version=${RELEASE_VERSION/v/}" >> "$GITHUB_OUTPUT"
env:
RELEASE_VERSION: ${{ github.event.release.tag_name }}
outputs:
version: ${{ steps.parse-version.outputs.version }}
publish-test-pypi:
needs: release-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install build
python3 -m pip install twine
- name: Build package
run: |
echo "Building package of version ${RELEASE_VERSION}"
python3 -m build
- name: Check package build
run: python3 -m twine check dist/*
- name: Publish package to Test-PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
env:
RELEASE_VERSION: ${{ needs.release-version.outputs.version }}
test-test-pypi:
needs: [release-version, publish-test-pypi]
uses: ./.github/workflows/tests.yml
with:
install_command: "python3 -m pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple gpu-tracker==${{ needs.release-version.outputs.version }}"
# - name: Publish package to PyPi
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}