Skip to content

Commit

Permalink
use pypa action
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyfast committed Nov 21, 2023
1 parent aa8531d commit 15b4035
Showing 1 changed file with 25 additions and 27 deletions.
52 changes: 25 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@

name: Python package
on:
push:
tags:
- '*'
release:
types: [published]
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch
- name: Test the project
run: hatch run test:run
- name: Build
run: hatch build
- name: Publish package
run: hatch publish -r test
if: github.event_name != 'release'
- name: Test the released packaged
run: hatch run release:test
if: github.event_name != 'release'
- name: Publish to mainline
run: hatch publish --user
if: github.event_name != 'release'
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch
- name: Test the project
run: hatch run test:run
- name: Build
run: hatch build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
if: github.event_name != 'release'
- name: Test the released packaged
run: hatch run release:test
if: github.event_name != 'release'
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name != 'release'

0 comments on commit 15b4035

Please sign in to comment.