debug #543
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Test | |
on: [push] | |
permissions: | |
contents: read | |
jobs: | |
determine_version: | |
name: Determine Version | |
runs-on: ubuntu-24.04 | |
outputs: | |
release_version: ${{ steps.set_version.outputs.version }} | |
container: | |
image: danielflook/python-minifier-build:python3.14-2025-08-21 | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
show-progress: false | |
persist-credentials: false | |
- name: Discover version | |
id: set_version | |
run: | | |
pip3 install setuptools_scm | |
VERSION="$(python3 -m setuptools_scm)" | |
echo "Version: $VERSION" | |
echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
create_release: | |
name: Create Draft Release | |
runs-on: ubuntu-24.04 | |
needs: | |
- determine_version | |
permissions: | |
contents: write | |
outputs: | |
release_id: ${{ steps.create_release.outputs.release_id }} | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 1 | |
show-progress: false | |
persist-credentials: false | |
- name: Generate Release Notes | |
env: | |
VERSION: "Unreleased" | |
run: | | |
cp .github/release_preamble.md release_body.md | |
changelog_section=$(awk '/^## \['"$VERSION"'\]/{flag=1; next} /^## \[/{flag=0} flag' CHANGELOG.md) | |
if [ -z "$changelog_section" ]; then | |
echo "Error: No changelog section found for version $VERSION" | |
exit 1 | |
fi | |
echo "$changelog_section" >> release_body.md | |
- name: Create Draft Release | |
id: create_release | |
env: | |
VERSION: ${{ needs.determine_version.outputs.release_version }} | |
run: | | |
set -e | |
gh release create "$VERSION" \ | |
--draft \ | |
--title "$VERSION" \ | |
--notes-file release_body.md | |
release_id=$(gh api repos/:owner/:repo/releases/tags/"$VERSION" --jq .id) | |
echo "release_id=$release_id" >> "$GITHUB_OUTPUT" | |
create_artifacts: | |
name: Create Artifacts | |
uses: ./.github/workflows/create_release_artifacts.yaml | |
needs: | |
- determine_version | |
with: | |
release_version: ${{ needs.determine_version.outputs.release_version }} | |
upload_artifacts: | |
name: Upload Artifacts to Release | |
needs: | |
- create_release | |
- create_artifacts | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: write | |
steps: | |
- name: Download distribution artifacts | |
uses: actions/[email protected] | |
with: | |
pattern: dist-* | |
path: dist/ | |
merge-multiple: true | |
- name: Upload Release Assets | |
env: | |
VERSION: ${{ needs.determine_version.outputs.release_version }} | |
run: | | |
gh release upload "$VERSION" \ | |
dist/${{ needs.create_artifacts.outputs.sdist }} \ | |
dist/${{ needs.create_artifacts.outputs.py3_wheel }} \ | |
dist/${{ needs.create_artifacts.outputs.py2_wheel }} |