Skip to content

Release

Release #2

Workflow file for this run

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