Skip to content

Commit

Permalink
fix: fixed job deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
libialany committed Jun 12, 2024
1 parent 111f358 commit 292442c
Showing 1 changed file with 7 additions and 39 deletions.
46 changes: 7 additions & 39 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,14 @@ on:
- master

jobs:
check-token:
runs-on: ubuntu-latest
steps:
- name: Check token variable
env:
PYPI_TOKEN_VAR: ${{ secrets.pypi_token }}
run: |
if [ -z "$PYPI_TOKEN_VAR" ]; then
echo "Pypi token variable is empty!"
exit 1
fi
echo "Pypi token variable is set!"
build:
name: Build package
needs: check-token
deploy:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/mozdownload
permissions:
id-token: write
steps:
- uses: actions/checkout@v4

Expand All @@ -36,29 +28,5 @@ jobs:
- name: Build a binary wheel and a source tarball
run: python -m build

- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist

pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/mozdownload
permissions:
id-token: write
needs: [check-token, build]
steps:
- name: Download dist folder
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist
- name: Upload release to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: dist/
password: ${{ secrets.pypi_token }}

0 comments on commit 292442c

Please sign in to comment.