Release #2
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 | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| uses: ./.github/workflows/build.yml | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Compute version | |
| id: version | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| BASE=$(date -u +'%Y.%-m.%-d') | |
| EXISTING=$(gh api "repos/${{ github.repository }}/git/matching-refs/tags/${BASE}" \ | |
| --jq '.[].ref' 2>/dev/null || true) | |
| if [ -z "$EXISTING" ]; then | |
| VERSION="$BASE" | |
| else | |
| if echo "$EXISTING" | grep -qx "refs/tags/${BASE}"; then | |
| MAX_R=$(echo "$EXISTING" | grep -oP "refs/tags/\Q${BASE}\E-r\K[0-9]+" | sort -n | tail -1) | |
| if [ -z "$MAX_R" ]; then | |
| VERSION="${BASE}-r1" | |
| else | |
| VERSION="${BASE}-r$((MAX_R + 1))" | |
| fi | |
| else | |
| VERSION="$BASE" | |
| fi | |
| fi | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "Computed version: $VERSION" | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: build-wixl | |
| path: wixl | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: build-libmsi | |
| path: libmsi | |
| - name: Create release archives | |
| run: | | |
| zip -r wixl.zip wixl/ | |
| zip -r libmsi.zip libmsi/ | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release create "${{ steps.version.outputs.version }}" \ | |
| --target "${{ github.sha }}" \ | |
| --title "${{ steps.version.outputs.version }}" \ | |
| --generate-notes \ | |
| wixl.zip \ | |
| libmsi.zip |