Skip to content

Commit

Permalink
ci(release.yaml): create release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
slaclau committed Sep 15, 2024
1 parent c435b87 commit 926ea57
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- master
- develop
pull_request:
pull_request:

workflow_dispatch:

Expand All @@ -22,6 +22,8 @@ jobs:
uses: ./.github/workflows/test.yaml
lint:
uses: ./.github/workflows/lint.yaml
release:
uses: ./.github/workflows/release.yaml
# Build job
build-docs:
runs-on: ubuntu-latest
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

on:
workflow_call:

jobs:
release:
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/<package-name> # Replace <package-name> with your PyPI project name
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Build
run: python -m build
- name: Release
uses: softprops/action-gh-release@v1
with:
files: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 926ea57

Please sign in to comment.