Add nightly rom releases (#182)
* Add nightly rom releases * Begin testing CI * Add tests workflow * Move release tag workflow * Fix upload logic for intermediate artifact * Fix variable add names * Update build CI * Update nightly upload location * Add git hash to output * Update upload location again * Update name to have a date * Adjust date format for consistency
This commit is contained in:
@@ -4,21 +4,31 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
tags:
|
|
||||||
- "v*"
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
clear_cache:
|
clear-cache:
|
||||||
description: 'Clear docker cache before running'
|
description: 'Clear docker cache before running'
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
upload-build-artifact:
|
||||||
|
required: true
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
run-tests-job:
|
||||||
|
name: Run tests
|
||||||
|
uses: ./.github/workflows/run_tests_ci_workflow.yml
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
name: Build ROM
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: run-tests-job
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
@@ -30,7 +40,7 @@ jobs:
|
|||||||
key: docker-images-${{ hashFiles('docker-compose.yml') }}
|
key: docker-images-${{ hashFiles('docker-compose.yml') }}
|
||||||
|
|
||||||
- name: Clear docker cache (if requested)
|
- name: Clear docker cache (if requested)
|
||||||
if: github.event.inputs.clear_cache == 'true'
|
if: github.event.inputs.clear-cache == 'true'
|
||||||
run: |
|
run: |
|
||||||
echo "Clearing Docker cache..."
|
echo "Clearing Docker cache..."
|
||||||
rm -rf /tmp/docker-cache
|
rm -rf /tmp/docker-cache
|
||||||
@@ -53,14 +63,13 @@ jobs:
|
|||||||
echo "UID=$(id -u)" >> "$GITHUB_ENV"
|
echo "UID=$(id -u)" >> "$GITHUB_ENV"
|
||||||
echo "GID=$(id -g)" >> "$GITHUB_ENV"
|
echo "GID=$(id -g)" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Run Tests
|
|
||||||
run: cd tests && ./run_tests.sh
|
|
||||||
|
|
||||||
- name: Build the project
|
- name: Build the project
|
||||||
run: docker compose -f docker-compose.yml run --rm balatro sh -c "make -j$(nproc) && ./scripts/get_memory_map.sh"
|
run: docker compose -f docker-compose.yml run --rm balatro sh -c "make -j$(nproc) && ./scripts/get_memory_map.sh"
|
||||||
|
|
||||||
- uses: softprops/action-gh-release@v2
|
- name: 'Upload Artifact'
|
||||||
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
if: ${{ inputs.upload-build-artifact }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
files: |
|
name: build-out
|
||||||
build/balatro-gba.gba
|
path: build
|
||||||
|
retention-days: 5
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
name: Deploy Nightly
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 2 * * *' # run at 2 AM UTC
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-job:
|
||||||
|
name: Run Build ROM Workflow
|
||||||
|
uses: ./.github/workflows/build_ci_workflow.yml
|
||||||
|
with:
|
||||||
|
upload-build-artifact: true
|
||||||
|
|
||||||
|
nightly:
|
||||||
|
name: Deploy nightly
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build-job
|
||||||
|
steps:
|
||||||
|
- name: Download the build output
|
||||||
|
uses: actions/download-artifact@v5
|
||||||
|
with:
|
||||||
|
name: build-out
|
||||||
|
path: build
|
||||||
|
|
||||||
|
- name: Package Release
|
||||||
|
run: mv build/balatro-gba.gba build/balatro-gba_nightly_$(date +'%+4Y%m%d')_$(cat build/githash.txt).gba && zip release.zip build/*.gba
|
||||||
|
|
||||||
|
- name: Deploy release
|
||||||
|
uses: WebFreak001/deploy-nightly@v3.2.0
|
||||||
|
with:
|
||||||
|
upload_url: https://uploads.github.com/repos/cellos51/balatro-gba/releases/258698380/assets{?name,label}
|
||||||
|
release_id: 258698380
|
||||||
|
asset_path: ./release.zip # path to archive to upload
|
||||||
|
asset_name: nightly-gbalatro-$$.zip # name to upload the release as, use $$ to insert date (YYYYMMDD) and 6 letter commit hash
|
||||||
|
asset_content_type: application/zip
|
||||||
|
max_releases: 7
|
||||||
|
ignore_hash: false # Only upload unique versions
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
name: Run Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
run_tests:
|
||||||
|
name: Run Tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Run Tests
|
||||||
|
run: cd tests && ./run_tests.sh
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
name: Release On Version Tag
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-job:
|
||||||
|
name: Run Build ROM Workflow
|
||||||
|
uses: ./.github/workflows/build_ci_workflow.yml
|
||||||
|
with:
|
||||||
|
upload-build-artifact: true
|
||||||
|
|
||||||
|
release:
|
||||||
|
name: Release Tagged Version
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build-job
|
||||||
|
steps:
|
||||||
|
- name: Download the build output
|
||||||
|
uses: actions/download-artifact@v5
|
||||||
|
with:
|
||||||
|
name: build-out
|
||||||
|
path: build
|
||||||
|
|
||||||
|
- uses: softprops/action-gh-release@v2
|
||||||
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
build/balatro-gba.gba
|
||||||
@@ -133,6 +133,7 @@ export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
|
|||||||
$(BUILD):
|
$(BUILD):
|
||||||
@[ -d $@ ] || mkdir -p $@
|
@[ -d $@ ] || mkdir -p $@
|
||||||
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
|
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
|
||||||
|
@echo "$(GIT_HASH)$(GIT_DIRTY)" > $@/githash.txt
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
Reference in New Issue
Block a user