Skip to content

improve fetching data and fixed additional information error #12

improve fetching data and fixed additional information error

improve fetching data and fixed additional information error #12

Workflow file for this run

name: Release package
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # normal release
- "v[0-9]+.[0-9]+.[0-9]+rc[0-9]+" # release candidate
- "v[0-9]+.[0-9]+.[0-9]+[ab][0-9]+" # alpha or beta release
jobs:
build:
uses: ./.github/workflows/build.yml
upload:
runs-on: ubuntu-latest
needs: build
outputs:
DO_GITHUB_RELEASE: ${{ steps.detect-release.outputs.DO_GITHUB_RELEASE }}
steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: distributions
path: dist
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Detect release version
id: detect-release
run: |
do_github_release=$((echo "${GITHUB_REF}" | grep -Eq "^refs\/tags\/v[0-9]+\.[0-9]+\.[0-9]+(rc[0-9]+)?$") && echo 1 || echo 0)
echo DO_GITHUB_RELEASE=$do_github_release >> $GITHUB_OUTPUT
echo DO_GITHUB_RELEASE=$do_github_release
publish:
runs-on: ubuntu-latest
needs: upload
if: needs.upload.outputs.DO_GITHUB_RELEASE == '1'
permissions:
contents: write
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Download Build
uses: actions/download-artifact@v3
with:
name: distributions
path: dist
- name: Detect prerelease
run: |
do_prerelease=$((echo "${GITHUB_REF}" | grep -Eq "^refs\/tags\/v[0-9]+\.[0-9]+\.[0-9]+rc[0-9]+$") && echo 1 || echo 0)
echo DO_PRERELEASE=$do_prerelease >> $GITHUB_ENV
echo DO_PRERELEASE=$do_prerelease
- name: Attach artifacts to github release
uses: softprops/action-gh-release@v1
with:
files: |
dist/*.whl
CHANGELOG.md
prerelease: ${{ env.DO_PRERELEASE == '1' }}
body_path: CHANGELOG.md