Create a snapshot release #74
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 | |
# To make the environment in the flake's devShell available to future steps: | |
- uses: rrbutani/use-nix-shell-action@v1 | |
with: | |
devShell: .#default | |
- name: Update Doom2D related inputs | |
run: | | |
nix flake update d2df-sdl d2df-editor doom2df-res | |
D2DF_REV=$(nix flake metadata . --json 2>/dev/null | jq --raw-output '.locks.nodes."d2df-sdl".locked.rev') | |
EDITOR_REV=$(nix flake metadata . --json 2>/dev/null | jq --raw-output '.locks.nodes."d2df-editor".locked.rev') | |
RES_REV=$(nix flake metadata . --json 2>/dev/null | jq --raw-output '.locks.nodes."doom2df-res".locked.rev') | |
git clone https://repo.or.cz/d2df-sdl | |
git clone https://repo.or.cz/d2df-editor | |
git clone https://github.com/Doom2D/DF-Res | |
D2DF_LAST_COMMIT_DATE=$(git --git-dir d2df-sdl/.git show -s --format=%ad --date=iso $D2DF_REV) | |
EDITOR_LAST_COMMIT_DATE=$(git --git-dir d2df-editor/.git show -s --format=%ad --date=iso $EDITOR_REV) | |
RES_LAST_COMMIT_DATE=$(git --git-dir DF-Res/.git show -s --format=%ad --date=iso $RES_REV) | |
echo "D2DF_REV=$D2DF_REV" >> "$GITHUB_ENV" | |
echo "EDITOR_REV=$RES_REV" >> "$GITHUB_ENV" | |
echo "RES_REV=$RES_REV" >> "$GITHUB_ENV" | |
echo "D2DF_LAST_COMMIT_DATE=\"$D2DF_LAST_COMMIT_DATE\"" >> "$GITHUB_ENV" | |
echo "EDITOR_LAST_COMMIT_DATE=\"$EDITOR_LAST_COMMIT_DATE\"" >> "$GITHUB_ENV" | |
echo "RES_LAST_COMMIT_DATE=\"$RES_LAST_COMMIT_DATE\"" >> "$GITHUB_ENV" | |
printf 'This build has the following inputs:\nd2df-sdl: %s\ndoom2d-res: %s\nd2df-editor: %s' $D2DF_REV $RES_REV $EDITOR_REV > release_body | |
- name: Build debug APK | |
run: | | |
nix build --print-build-logs .#legacyPackages.x86_64-linux.android.bundles.default | |
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 | |
env: | |
D2DF_LAST_COMMIT_DATE: ${{ env.D2DF_LAST_COMMIT_DATE }} | |
RES_LAST_COMMIT_DATE: ${{ env.RES_LAST_COMMIT_DATE }} | |
EDITOR_LAST_COMMIT_DATE: ${{ env.D2DF_LAST_COMMIT_DATE }} | |
run: | | |
bash ./game/bundle/mkZip.bash | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: doom2df-win32 | |
path: doom2df-win32.zip | |
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 |