Skip to content

Commit

Permalink
publish workflow (#2)
Browse files Browse the repository at this point in the history
publish workflow
  • Loading branch information
0x00b1 authored Apr 1, 2024
1 parent 798352f commit a7ca349
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
jobs:
build:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.x"
- run: "python -m pip install --upgrade build"
- run: "python -m build ."
- uses: "actions/upload-artifact@v3"
with:
name: "python-package-distributions"
path: "dist/"
test:
environment:
name: "pypi.org"
url: "https://pypi.org/project/beignet"
needs:
- "build"
permissions:
id-token: "write"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/download-artifact@v3"
with:
name: "python-package-distributions"
path: "dist/"
- uses: "pypa/gh-action-pypi-publish@release/v1"
with:
repository-url: "https://test.pypi.org/legacy/"
publish:
environment:
name: "pypi.org"
url: "https://pypi.org/project/beignet"
if: "startsWith(github.ref, 'refs/tags/')"
needs:
- "build"
permissions:
id-token: "write"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/download-artifact@v3"
with:
name: "python-package-distributions"
path: "dist/"
- uses: "pypa/gh-action-pypi-publish@release/v1"
release:
needs:
- "publish"
permissions:
contents: "write"
id-token: "write"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/download-artifact@v3"
with:
name: "python-package-distributions"
path: "dist/"
- uses: "sigstore/[email protected]"
with:
inputs: "./dist/*.tar.gz ./dist/*.whl"
- env:
GITHUB_TOKEN: "${{ github.token }}"
run: "gh release create '${{ github.ref_name }}' --notes '' --repo '${{ github.repository }}'"
- env:
GITHUB_TOKEN: "${{ github.token }}"
run: "gh release upload '${{ github.ref_name }}' dist/** --repo '${{ github.repository }}'"
on: "push"

0 comments on commit a7ca349

Please sign in to comment.