chore: release 1.1.87 #211
Workflow file for this run
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: Create GitHub Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Tag to release (e.g. v1.1.30)' | |
| required: true | |
| type: string | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| permissions: | |
| contents: write | |
| outputs: | |
| version: ${{ steps.src.outputs.version }} | |
| sha256: ${{ steps.src.outputs.sha256 }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Resolve release tag | |
| run: | | |
| TAG="${{ github.event.inputs.tag || github.ref_name }}" | |
| echo "RELEASE_TAG=$TAG" >> $GITHUB_ENV | |
| - name: Extract changelog for this version | |
| id: changelog | |
| run: | | |
| VERSION="${RELEASE_TAG#v}" | |
| NOTES=$(awk "/^## \[$VERSION\]/{flag=1; next} /^## \[/{flag=0} flag" CHANGELOG.md | sed '/^$/N;/^\n$/d') | |
| echo "notes<<EOF" >> $GITHUB_OUTPUT | |
| echo "$NOTES" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Install uv and build wheel | |
| run: | | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| export PATH="$HOME/.cargo/bin:$PATH" | |
| python3 --version | awk '{split($2,v,"."); print v[1]"."v[2]}' > .python-version | |
| uv build | |
| - name: Build .deb package | |
| run: bash debian/build-deb.sh | |
| - name: Build deterministic source tarball for AUR | |
| id: src | |
| run: | | |
| VERSION="${RELEASE_TAG#v}" | |
| # Output to build/aur/ rather than dist/ so the AUR archive is NOT | |
| # picked up by `pypi-publish` (twine rejects the hyphenated name). | |
| mkdir -p build/aur | |
| git archive --format=tar.gz \ | |
| --prefix="Arctis-Sound-Manager-${VERSION}/" \ | |
| HEAD \ | |
| -o "build/aur/arctis-sound-manager-${VERSION}.tar.gz" | |
| SHA=$(sha256sum "build/aur/arctis-sound-manager-${VERSION}.tar.gz" | awk '{print $1}') | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "sha256=$SHA" >> $GITHUB_OUTPUT | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.event.inputs.tag || github.ref_name }} | |
| name: ${{ github.event.inputs.tag || github.ref_name }} | |
| body: ${{ steps.changelog.outputs.notes }} | |
| files: | | |
| dist/*.whl | |
| dist/*.tar.gz | |
| build/aur/*.tar.gz | |
| build/deb/*.deb | |
| draft: false | |
| prerelease: ${{ contains(github.event.inputs.tag || github.ref_name, 'b') }} | |
| update-generated-files: | |
| runs-on: ubuntu-latest | |
| needs: release | |
| if: "!contains(github.event.inputs.tag || github.ref_name, 'b')" | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| fetch-depth: 0 | |
| - name: Regenerate debian/changelog and AppStream metainfo | |
| run: | | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| export PATH="$HOME/.cargo/bin:$PATH" | |
| python3 --version | awk '{split($2,v,"."); print v[1]"."v[2]}' > .python-version | |
| uv run python3 scripts/generate_debian_changelog.py --in-place | |
| uv run python3 scripts/generate_metainfo_releases.py --in-place | |
| - name: Commit generated files to main | |
| run: | | |
| git config user.name "loteran" | |
| git config user.email "axel.valadon@gmail.com" | |
| git add debian/changelog \ | |
| src/arctis_sound_manager/desktop/com.github.loteran.arctis-sound-manager.metainfo.xml | |
| git diff --cached --quiet && echo "No generated files changed" && exit 0 | |
| git commit -m "chore: regenerate debian/changelog + metainfo for v${{ needs.release.outputs.version }} [skip ci]" | |
| git push origin main | |
| aur-update: | |
| runs-on: ubuntu-latest | |
| needs: [release, update-generated-files] | |
| if: "!contains(github.event.inputs.tag || github.ref_name, 'b')" | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| fetch-depth: 0 | |
| - name: Set up SSH for AUR | |
| env: | |
| AUR_SSH_KEY: ${{ secrets.AUR_SSH_KEY }} | |
| run: | | |
| mkdir -p ~/.ssh | |
| echo "$AUR_SSH_KEY" > ~/.ssh/aur_key | |
| chmod 600 ~/.ssh/aur_key | |
| ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts | |
| cat >> ~/.ssh/config << 'SSHCONF' | |
| Host aur.archlinux.org | |
| IdentityFile ~/.ssh/aur_key | |
| User aur | |
| SSHCONF | |
| - name: Clone AUR repository | |
| run: git clone ssh://aur@aur.archlinux.org/arctis-sound-manager.git /tmp/aur-repo | |
| - name: Patch PKGBUILD and regenerate .SRCINFO | |
| run: | | |
| SHA="${{ needs.release.outputs.sha256 }}" | |
| VERSION="${{ needs.release.outputs.version }}" | |
| # Patch PKGBUILD (version + real sha256) | |
| sed "s/pkgver=.*/pkgver=${VERSION}/; s/sha256sums=('[^']*')/sha256sums=('${SHA}')/" \ | |
| aur/PKGBUILD > /tmp/aur-repo/PKGBUILD | |
| # Regenerate .SRCINFO from the patched PKGBUILD via the dedicated script. | |
| # This guarantees deps in .SRCINFO always match PKGBUILD — no sed drift. | |
| python3 scripts/generate_srcinfo.py \ | |
| --pkgbuild /tmp/aur-repo/PKGBUILD \ | |
| --sha256 "${SHA}" \ | |
| --version "${VERSION}" \ | |
| > /tmp/aur-repo/.SRCINFO | |
| cp aur/arctis-sound-manager.install /tmp/aur-repo/arctis-sound-manager.install | |
| - name: Commit and push to AUR | |
| run: | | |
| cd /tmp/aur-repo | |
| git config user.name "loteran" | |
| git config user.email "axel.valadon@gmail.com" | |
| git add PKGBUILD .SRCINFO arctis-sound-manager.install | |
| git diff --cached --quiet && echo "No changes to push" && exit 0 | |
| git commit -m "Update to v${{ needs.release.outputs.version }}" | |
| git push | |
| - name: Verify and self-heal AUR | |
| run: | | |
| VERSION="${{ needs.release.outputs.version }}" | |
| SHA="${{ needs.release.outputs.sha256 }}" | |
| # 1 — Verify what was actually committed to AUR git (not the RPC index, | |
| # which can lag several minutes). Re-clone to get the latest state. | |
| git clone ssh://aur@aur.archlinux.org/arctis-sound-manager.git /tmp/aur-verify | |
| ACTUAL_VER=$(grep "^pkgver=" /tmp/aur-verify/PKGBUILD | cut -d= -f2) | |
| echo "AUR git pkgver: '${ACTUAL_VER}' (expected '${VERSION}')" | |
| if [ "${ACTUAL_VER}" != "${VERSION}" ]; then | |
| echo "Wrong version in AUR git — re-patching and re-pushing..." | |
| sed "s/pkgver=.*/pkgver=${VERSION}/; s/sha256sums=('[^']*')/sha256sums=('${SHA}')/" \ | |
| aur/PKGBUILD > /tmp/aur-verify/PKGBUILD | |
| sed -e "s/pkgver = .*/pkgver = ${VERSION}/" \ | |
| -e "s/arctis-sound-manager-[0-9][0-9.]*\.tar\.gz/arctis-sound-manager-${VERSION}.tar.gz/g" \ | |
| -e "s|releases/download/v[0-9][0-9.]*/|releases/download/v${VERSION}/|g" \ | |
| -e "s/sha256sums = [^ ]*/sha256sums = ${SHA}/" \ | |
| aur/.SRCINFO > /tmp/aur-verify/.SRCINFO | |
| cp aur/arctis-sound-manager.install /tmp/aur-verify/arctis-sound-manager.install | |
| cd /tmp/aur-verify | |
| git config user.name "loteran" | |
| git config user.email "axel.valadon@gmail.com" | |
| git add PKGBUILD .SRCINFO arctis-sound-manager.install | |
| git diff --cached --quiet && echo "Nothing to fix." || git commit -m "Fix: update to v${VERSION}" && git push | |
| cd - | |
| fi | |
| # 2 — Wait for the AUR RPC index to propagate (can take up to ~10 min). | |
| aur_version() { | |
| curl -fsSL "https://aur.archlinux.org/rpc/?v=5&type=info&arg=arctis-sound-manager" \ | |
| | python3 -c "import sys,re; raw=sys.stdin.read(); m=re.search(r'\"Version\":\"([^\"]+)\"',raw); print(m.group(1) if m else '')" 2>/dev/null || true | |
| } | |
| echo "Waiting for AUR RPC index to update..." | |
| for i in $(seq 1 24); do | |
| AUR_VER=$(aur_version) | |
| echo " attempt ${i}/24 — RPC version: '${AUR_VER}'" | |
| if [ "${AUR_VER}" = "${VERSION}-1" ] || [ "${AUR_VER}" = "${VERSION}" ]; then | |
| echo "AUR index confirmed: ${AUR_VER}" | |
| exit 0 | |
| fi | |
| sleep 30 | |
| done | |
| echo "WARNING: AUR RPC index did not update after 12 min (AUR server lag)." | |
| echo "The correct PKGBUILD is in AUR git — users will get the right version on next paru sync." | |
| - name: Sync aur/ template + generated files back to main | |
| run: | | |
| VERSION="${{ needs.release.outputs.version }}" | |
| git config user.name "loteran" | |
| git config user.email "axel.valadon@gmail.com" | |
| git fetch origin main | |
| git checkout -B main-aur-sync origin/main | |
| # AUR packaging | |
| sed -i "s/pkgver=.*/pkgver=${VERSION}/" aur/PKGBUILD | |
| sed -i "s/sha256sums=('[^']*')/sha256sums=('SKIP')/" aur/PKGBUILD | |
| sed -i "s/pkgver = .*/pkgver = ${VERSION}/" aur/.SRCINFO | |
| sed -i "s/arctis-sound-manager-[0-9][0-9.]*\.tar\.gz/arctis-sound-manager-${VERSION}.tar.gz/g" aur/.SRCINFO | |
| sed -i "s|releases/download/v[0-9][0-9.]*/|releases/download/v${VERSION}/|g" aur/.SRCINFO | |
| sed -i "s/sha256sums = [^ ]*/sha256sums = SKIP/" aur/.SRCINFO | |
| sed -i "s/^version = \"[^\"]*\"/version = \"${VERSION}\"/" pyproject.toml | |
| git add aur/PKGBUILD aur/.SRCINFO pyproject.toml debian/changelog \ | |
| src/arctis_sound_manager/desktop/com.github.loteran.arctis-sound-manager.metainfo.xml | |
| git diff --cached --quiet && echo "No changes to sync" && exit 0 | |
| git commit -m "chore: sync packaging + generated files to v${VERSION} [skip ci]" | |
| git push origin HEAD:main | |
| copr-build: | |
| runs-on: ubuntu-latest | |
| needs: release | |
| if: "!contains(github.event.inputs.tag || github.ref_name, 'b')" | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install copr-cli | |
| run: pip install copr-cli | |
| - name: Configure copr-cli | |
| env: | |
| COPR_API_CONFIG: ${{ secrets.COPR_API_CONFIG }} | |
| run: | | |
| mkdir -p ~/.config | |
| echo "$COPR_API_CONFIG" > ~/.config/copr | |
| - name: Update spec version | |
| run: | | |
| VERSION="${{ needs.release.outputs.version }}" | |
| git config user.name "loteran" | |
| git config user.email "axel.valadon@gmail.com" | |
| git fetch origin main | |
| git checkout -B main-spec-sync origin/main | |
| sed -i "s/^Version:.*/Version: ${VERSION}/" arctis-sound-manager.spec | |
| git add arctis-sound-manager.spec | |
| git diff --cached --quiet || git commit -m "chore: bump spec to ${VERSION}" | |
| git push origin HEAD:main || true | |
| - name: Trigger COPR build | |
| run: | | |
| copr-cli buildscm \ | |
| --clone-url https://github.com/loteran/Arctis-Sound-Manager \ | |
| --commit "v${{ needs.release.outputs.version }}" \ | |
| --method make_srpm \ | |
| --nowait \ | |
| loteran/arctis-sound-manager | |
| # Auto-publish to PyPI by calling pypi-publish.yaml as a reusable workflow. | |
| # This makes the OIDC job_workflow_ref claim resolve to pypi-publish.yaml, so | |
| # it matches the existing PyPI Trusted Publisher (workflow = pypi-publish.yaml) | |
| # — no separate publisher for release.yaml is needed. | |
| pypi-publish: | |
| needs: release | |
| # Skip beta/pre-release tags, like aur-update and copr-build. | |
| if: "!contains(github.event.inputs.tag || github.ref_name, 'b')" | |
| permissions: | |
| id-token: write # OIDC for the PyPI Trusted Publisher | |
| contents: read | |
| uses: ./.github/workflows/pypi-publish.yaml | |
| with: | |
| tag: ${{ github.event.inputs.tag || github.ref_name }} |