Merge pull request #92 from overwrite00/develop #40
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: Promote Beta to Stable Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| - '!v*-beta.*' | |
| workflow_dispatch: | |
| inputs: | |
| beta_tag: | |
| description: 'Beta tag to promote (leave empty to auto-select the latest beta)' | |
| required: false | |
| type: string | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: stable-release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| promote: | |
| name: Promote latest beta artifacts to stable | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Resolve target beta release | |
| id: beta | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| BETA_TAG_INPUT: ${{ github.event.inputs.beta_tag }} | |
| run: | | |
| if [ -n "$BETA_TAG_INPUT" ]; then | |
| TAG="$BETA_TAG_INPUT" | |
| else | |
| TAG=$(gh release list --repo "${{ github.repository }}" --limit 50 --json tagName,isPrerelease,createdAt \ | |
| --jq '[.[] | select(.isPrerelease == true)] | sort_by(.createdAt) | last | .tagName // empty') | |
| fi | |
| if [ -z "$TAG" ]; then | |
| echo "::error::No beta release found to promote. Publish a beta release first (tag v*-beta.*) or pass beta_tag explicitly." | |
| exit 1 | |
| fi | |
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | |
| echo "Promoting beta release: $TAG" | |
| - name: Download beta release assets | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| mkdir -p stable-assets | |
| gh release download "${{ steps.beta.outputs.tag }}" --repo "${{ github.repository }}" --dir stable-assets \ | |
| --pattern "NullifyPDF_v*_Windows.exe" \ | |
| --pattern "NullifyPDF_v*_macOS.zip" \ | |
| --pattern "NullifyPDF_v*_Ubuntu.deb" \ | |
| --pattern "NullifyPDF_v*_Fedora.rpm" | |
| - name: Strip beta suffix from filenames | |
| run: | | |
| cd stable-assets | |
| for f in *; do | |
| new="$(echo "$f" | sed -E 's/-beta\.[0-9]+//')" | |
| if [ "$f" != "$new" ]; then | |
| mv "$f" "$new" | |
| fi | |
| done | |
| ls -la | |
| - name: Create Stable Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| files: stable-assets/* | |
| prerelease: false | |
| body: | | |
| Release Stabile NullifyPDF. | |
| Promossa dalla beta `${{ steps.beta.outputs.tag }}` (build gia' verificata, nessuna ricompilazione). | |
| Include App Bundle macOS (ZIP), EXE per Windows e pacchetti nativi Linux. | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |