Create a snapshot release #25
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
name: CI | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: DeterminateSystems/nix-installer-action@main | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: Enter shell with needed dependencies | |
run: | | |
nix shell nixpkgs#jq nixpkgs#p7zip nixpkgs#git | |
- name: Update Doom2D related inputs | |
run: | | |
nix flake update d2df-sdl doom2df-res | |
D2DF_REV=$(nix flake metadata . --json 2>/dev/null | jq --raw-output '.locks.nodes."d2df-sdl".locked.rev') | |
RES_REV=$(nix flake metadata . --json 2>/dev/null | jq --raw-output '.locks.nodes."doom2df-res".locked.rev') | |
echo "D2DF_REV=$D2DF_REV" >> "$GITHUB_ENV" | |
echo "RES_REV=$RES_REV" >> "$GITHUB_ENV" | |
printf 'This build has the following inputs:\nd2df-sdl: %s\ndoom2d-res: %s' $D2DF_REV $RES_REV > release_body | |
- name: Build debug APK | |
run: | | |
nix build .#legacyPackages.x86_64-linux.android.doom2df-sdl2_mixer-apk | |
cp result doom2df-android.apk | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: doom2df-android | |
path: result | |
if-no-files-found: error | |
- name: Build Windows 32-bit ZIP bundle | |
run: | | |
nix build .#legacyPackages.x86_64-linux.mingw.byArch.mingw32.doom2df-bundle | |
7z a -tzip doom2df-win32.zip -w result/. | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: doom2df-win32 | |
path: result | |
if-no-files-found: error | |
- uses: ncipollo/release-action@v1 | |
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch'}} | |
with: | |
artifacts: doom2df-win32.zip, doom2df-android.apk | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: Doom2D Forever builds (latest commit) | |
bodyFile: release_body | |
tag: doom2dforever | |
allowUpdates: true | |
artifactErrorsFailBuild: true | |
prerelease: true | |
replacesArtifacts: true |