Nightly Build #233
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: Nightly Build | |
on: | |
schedule: | |
# cronjob that triggers every day at 2PM UTC | |
- cron: '0 14 * * *' | |
workflow_dispatch: | |
push: | |
jobs: | |
build_nightly: | |
runs-on: windows-latest | |
name: Build Nightly | |
outputs: | |
full_sha: ${{ steps.var.outputs.full_sha }} | |
short_sha: ${{ steps.var.outputs.short_sha }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Check CMake version | |
run: cmake --version | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v1 | |
- name: Generate CMake project | |
run: cmake -S. -Bbuild -G "Visual Studio 17 2022" -A Win32 -DCMAKE_CONFIGURATION_TYPES=Release | |
- name: Build 32bit release DLL | |
run: cmake --build build --config Release --target ALL_BUILD | |
- name: Upload binary Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: binary | |
path: build/Release/GD-Roulette.dll | |
- name: Generate Build Info | |
id: var | |
run: | | |
echo "full_sha=$(git rev-parse HEAD)" >> $env:GITHUB_OUTPUT | |
echo "short_sha=$(git rev-parse --short HEAD)" >> $env:GITHUB_OUTPUT | |
upload_resources: | |
runs-on: ubuntu-latest | |
name: Upload resources.zip | |
steps: | |
- name: Download resources file | |
uses: valitydev/action-download-file@v1.0.6 | |
with: | |
url: https://github.com/SpaghettDev/GD-Roulette/blob/master/assets/resources.zip | |
- name: Upload resources Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: resources | |
path: resources.zip | |
check_date: | |
runs-on: ubuntu-latest | |
name: Check latest commit | |
needs: [ build_nightly, upload_resources ] | |
outputs: | |
should_run: ${{ steps.should_run.outputs.should_run }} | |
steps: | |
- uses: actions/checkout@v3 | |
- id: should_run | |
continue-on-error: true | |
name: Check if latest commit date is within the previous 24 hours | |
if: ${{ github.event_name == 'schedule' }} | |
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "should_run=false" >> $GITHUB_OUTPUT | |
create_release: | |
runs-on: ubuntu-latest | |
name: Create Release | |
needs: [ check_date, upload_resources, build_nightly ] | |
if: ${{ needs.check_date.outputs.should_run != 'false' }} | |
steps: | |
- name: Download binary Artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: binary | |
- name: Download resources Artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: resources | |
- name: Echo build sha256 | |
id: build_sha | |
run: | | |
sha256sum GD-Roulette.dll > sha256.checksum | |
echo "build_sha=$(cat sha256.checksum)" >> $GITHUB_OUTPUT | |
cat sha256.checksum | |
#- name: Run latest-tag | |
# uses: EndBug/latest-tag@v1.5.1 | |
# with: | |
# ref: nightly | |
- name: Nightly Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Nightly [${{ needs.build_nightly.outputs.short_sha }}] | |
tag_name: nightly | |
body: | | |
**This release has been built by Github Actions** | |
[Link to build](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | |
Build SHA256: | |
``` | |
${{ steps.build_sha.outputs.build_sha }} | |
``` | |
Do not forget to copy the files from the [resources folder](https://github.com/SpaghettDev/GD-Roulette/tree/master/resources) into your Geometry Dash Resources folder! | |
Full Commit Hash: | |
``` | |
${{ needs.build_nightly.outputs.full_sha }} | |
``` | |
files: | | |
resources.zip | |
GD-Roulette.dll |