Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
speed1313 committed Sep 24, 2024
1 parent ef90fd8 commit 69b5628
Showing 1 changed file with 20 additions and 42 deletions.
62 changes: 20 additions & 42 deletions .github/workflows/python-publish.yml
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 }}

0 comments on commit 69b5628

Please sign in to comment.