Skip to content

Prerelease

Prerelease #14

Workflow file for this run

name: Prerelease
on:
push:
tags:
- v*
env:
DOWNLOAD: https://github.com/${{ github.repository }}/releases/download
ARCHIVE: https://github.com/${{ github.repository }}/archive
jobs:
release:
name: Create release
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install packages
run: |
sudo apt update
sudo apt install -y -o Acquire::Retries=50 pandoc
- name: Get version
run: |
echo TAG=${GITHUB_REF/refs\/tags\//} >> ${GITHUB_ENV}
echo VER=${GITHUB_REF/refs\/tags\/v/} >> ${GITHUB_ENV}
echo DATE=$(git show -s --format='%as') >> ${GITHUB_ENV}
- name: Check binary versions
run: |
grep --binary "wimboot ${TAG} --" wimboot
grep --binary "wimboot ${TAG} --" src/wimboot.i386
grep --binary "wimboot ${TAG} --" src/wimboot.x86_64
grep --binary "wimboot ${TAG} --" src/wimboot.arm64
- name: Extract changes
run: |
pandoc -f gfm -t gfm --columns=10000 CHANGELOG.md | \
sed -E -n '/^## \['${TAG}'\]/,/^##/{/^##/!p}' | tee CHANGES.md
[ -s CHANGES.md ]
- name: Construct release notes
run: |
BIN=${DOWNLOAD}/${TAG}/wimboot
BIN_I386=${DOWNLOAD}/${TAG}/wimboot.i386
BIN_ARM64=${DOWNLOAD}/${TAG}/wimboot.arm64
cat > NOTES.md <<EOF
Downloads
=========
Binaries
--------
- [wimboot](${BIN}) (for BIOS and 64-bit UEFI systems)
- [wimboot.i386](${BIN_I386}) (for BIOS and 32-bit UEFI systems)
- [wimboot.arm64](${BIN_ARM64}) (for AArch64 UEFI systems)
Source code
-----------
- [wimboot-${VER}.zip](${ARCHIVE}/${TAG}.zip)
- [wimboot-${VER}.tar.gz](${ARCHIVE}/${TAG}.tar.gz)
Changes
-------
EOF
cat CHANGES.md >> NOTES.md
cat NOTES.md
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${TAG} --verify-tag --prerelease \
--title "${TAG} (${DATE})" --notes-file NOTES.md \
wimboot src/wimboot.i386 src/wimboot.arm64