Skip to content

Commit

Permalink
add a release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyfast committed Nov 21, 2023
1 parent dd5f0c2 commit f370b3f
Showing 1 changed file with 34 additions and 0 deletions.
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: Python package
on:
push:
tags:
- '*'
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch
- name: Test the project
run: hatch run test:cov
- name: Build
run: hatch build
- name: Publish package
run: hatch publish -r test --user ${{secrets.HATCH_INDEX_USER}} --auth ${{secrets.HATCH_TEST_INDEX_AUTH}}
if: github.event_name != 'release'
- name: Test the released packaged
run: hatch run released:test
if: github.event_name != 'release'
- name: Publish to mainline
run: hatch publish --user ${{secrets.HATCH_INDEX_USER}} --auth ${{secrets.HATCH_INDEX_AUTH}}
if: github.event_name != 'release'

0 comments on commit f370b3f

Please sign in to comment.