diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0171b73..fdaaf6a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,6 +72,13 @@ jobs: - config - check steps: + - name: Define package name + id: vars + run: | + set -eux + PACKAGE_NAME=$(cat pyproject.toml | grep -xoE "name = \"(.*?)\"" | sed -r 's/name = "(.*?)"/\1/') + echo "package_name=${PACKAGE_NAME}_${{ needs.config.outputs.version_or_latest }}" >> "$GITHUB_OUTPUT" + - name: Check out the repository uses: actions/checkout@v4 @@ -94,17 +101,10 @@ jobs: set -eux sed -i "s/version = "999.999.999"/version = \"${{ needs.config.outputs.version_or_latest }}\"/" pyproject.toml - - name: Extract package name - id: package_name - run: | - set -eux - PACKAGE_NAME=$(cat pyproject.toml | grep -xoE "name = \"(.*?)\"" | sed -r 's/name = "(.*?)"/\1/') - echo "package_name=${PACKAGE_NAME}_${{ needs.config.outputs.version_or_latest }}" >> "$GITHUB_OUTPUT" - - name: Packaging run: | set -eux - zip -r "${{ steps.package_name.output.package_name }}.zip" src/ + zip -r "${{ steps.vars.output.package_name }}.zip" src/ - name: Create release if: needs.config.outputs.version != '' @@ -115,6 +115,6 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ needs.config.outputs.version }} artifacts: > - ${{ steps.package_name.output.package_name }}.zip + ${{ steps.vars.output.package_name }}.zip commit: ${{ github.sha }} body: ${{ steps.tag_version.outputs.changelog }}