From 936902cdcfef892efc60803922aaacd976f82731 Mon Sep 17 00:00:00 2001 From: Sage Date: Sat, 20 Jan 2024 21:53:37 +0900 Subject: [PATCH] test: testyml --- .github/workflows/test.yml | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..6d6ad1a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,44 @@ +on: + push: + tags: + - '*' + + +name: release +jobs: + pypi-publish: + name: upload release to PyPI + runs-on: ubuntu-latest + # Specifying a GitHub environment is optional, but strongly encouraged + environment: release + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + steps: + # retrieve your distributions here + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install setuptools wheel twine + + - name: Extract tag name + id: tag + run: echo ::set-output name=TAG_NAME::${GITHUB_REF#refs/tags/} + + - name: Update version in setup.py + run: | + VERSION=${{ steps.tag.outputs.TAG_NAME }} + VERSION=${VERSION#v} + sed -i "s/{{VERSION_PLACEHOLDER}}/$VERSION/g" setup.py + + - name: Build and publish + run: | + python setup.py sdist bdist_wheel + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file