-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,26 @@ | ||
# This workflow will upload a Python Package using Twine when a release is created | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: Upload Python Package | ||
name: Release workflow | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
push: | ||
tags: | ||
- "v[0123456789].*" | ||
|
||
jobs: | ||
deploy: | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
- name: Install the latest version of rye | ||
uses: eifinger/setup-rye@v4 | ||
with: | ||
enable-cache: true | ||
- name: Sync dependencies | ||
run: rye sync | ||
- name: Get release tag | ||
id: get_tag | ||
run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
|
||
- name: Write version to _version.py | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install hatch | ||
hatch version ${RELEASE_TAG} | ||
- name: Build package | ||
run: rye build | ||
- name: publish | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- name: setup python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.x" | ||
- name: build | ||
run: | | ||
python -m pip install --upgrade build hatch | ||
python -m hatch version "${GITHUB_REF_NAME}" | ||
python -m build | ||
- name: publish | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |