From 69b5628a52d925def73d99475389c12652ccf2a1 Mon Sep 17 00:00:00 2001 From: speed1313 Date: Tue, 24 Sep 2024 18:13:40 +0900 Subject: [PATCH] fix --- .github/workflows/python-publish.yml | 62 +++++++++------------------- 1 file changed, 20 insertions(+), 42 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 2e60062..0fa4c43 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -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 }} \ No newline at end of file