Skip to content

Commit

Permalink
CI: automatic releases and PyPi upload
Browse files Browse the repository at this point in the history
  • Loading branch information
rkingsbury committed Jul 31, 2023
1 parent c175896 commit 426d5c9
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/post-process.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Post-process

on:
workflow_run:
types:
- completed
workflows:
# List all required workflow names here.
- 'testing'

jobs:
# https://github.com/marketplace/actions/tag-release-on-push-action
auto-gen-release:
name: Tag/Release on merge of labeled PRs
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- # It is often a desired behavior to merge only when a workflow execution
# succeeds. This can be changed as needed.
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: rymndhng/[email protected]
with:
# loonly release when PRs with release:major/minor/patch labels are merged
bump_version_scheme: norelease
use_github_release_notes: true
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: release

on:
release:
types: [published]

jobs:
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes

deploy:
runs-on: ubuntu-latest
environment: publish

steps:
- uses: actions/checkout@v3


- uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools setuptools_scm wheel tox
- name: Build packages for distribution
run: |
tox -e build
- name: Upload to PyPi
uses: pypa/[email protected]
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

0 comments on commit 426d5c9

Please sign in to comment.