Merge pull request #134 from volkertb/empty-feature-commits-to-improv… #132
Workflow file for this run
This file contains 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
# With thanks to https://gist.github.com/weibeld/f136048d0a82aacc063f42e684e3c494 | |
name: build-and-release | |
on: | |
push: | |
tags: | |
- '**' | |
permissions: | |
contents: write | |
jobs: | |
release-job: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
path: src | |
# We need this in order to generate a changelog from the commits between the latest and previous tags | |
fetch-depth: 0 | |
- name: Install DJGPP | |
run: | | |
wget -P /tmp https://github.com/andrewwutw/build-djgpp/releases/download/v3.4/djgpp-linux64-gcc1220.tar.bz2 | |
echo "8464f17017d6ab1b2bb2df4ed82357b5bf692e6e2b7fee37e315638f3d505f00 /tmp/djgpp-linux64-gcc1220.tar.bz2" | shasum -a 256 --check | |
tar -xf /tmp/djgpp-linux64-gcc1220.tar.bz2 -C /opt | |
rm /tmp/djgpp-linux64-gcc1220.tar.bz2 | |
- name: "✏️ Generate release changelog" | |
id: changelog | |
uses: requarks/changelog-action@v1 | |
with: | |
token: ${{ github.token }} | |
tag: ${{ github.ref_name }} | |
includeInvalidCommits: true | |
excludeTypes: "" | |
- name: Build project | |
run: | | |
cd $GITHUB_WORKSPACE/src | |
test -f main.c | |
. /opt/djgpp/setenv | |
make | |
test -f output/sbemu.exe | |
- name: Combine changelog and user instructions into release notes | |
run: | | |
cat $GITHUB_WORKSPACE/CHANGELOG.md $GITHUB_WORKSPACE/src/user_instructions.md > $GITHUB_WORKSPACE/RELEASE_NOTES.md | |
- name: Build FreeDOS SBEMU USB image and ZIP file | |
run: | | |
shellcheck $GITHUB_WORKSPACE/src/scripts/build-release-artifacts.sh | |
$GITHUB_WORKSPACE/src/scripts/build-release-artifacts.sh $GITHUB_WORKSPACE/src/output/sbemu.exe $GITHUB_WORKSPACE/RELEASE_NOTES.md $GITHUB_WORKSPACE/ | |
- name: Generate release tag | |
id: tag | |
run: | | |
echo "release_tag=Release_${{ github.ref_name }}" >> $GITHUB_OUTPUT | |
- name: Release FreeDOS SBEMU USB image | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.tag.outputs.release_tag }} | |
files: | | |
${{ github.workspace }}/SBEMU.zip | |
${{ github.workspace }}/SBEMU-FD13-USB.img.xz | |
body_path: ${{ github.workspace }}/RELEASE_NOTES.md |