115 lines
3.5 KiB
YAML
115 lines
3.5 KiB
YAML
name: Nightly Build
|
|
|
|
on:
|
|
schedule:
|
|
# cronjob that triggers every day at 2PM UTC
|
|
- cron: '0 14 * * *'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
check_date:
|
|
runs-on: ubuntu-latest
|
|
name: Check latest commit
|
|
outputs:
|
|
should_run: ${{ steps.should_run.outputs.should_run }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- 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 "::set-output name=should_run::false"
|
|
|
|
build_nightly:
|
|
runs-on: windows-latest
|
|
name: Build Nightly
|
|
needs: check_date
|
|
if: ${{ needs.check_date.outputs.should_run != 'false' }}
|
|
steps:
|
|
- uses: actions/checkout@v2.4.0
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Setup premake
|
|
uses: abel0b/setup-premake@v2
|
|
with:
|
|
version: "5.0.0-beta1"
|
|
|
|
- name: Add msbuild to PATH
|
|
uses: microsoft/setup-msbuild@v1.1
|
|
|
|
- name: Generate premake5 project
|
|
run: premake5 vs2019
|
|
shell: bash
|
|
|
|
- name: Build 64bit release DLL
|
|
run: |
|
|
msbuild /p:Configuration=Release /p:Platform=x64 BigBaseV2.sln
|
|
|
|
- name: Rename DLL to YimMenu.dll
|
|
run: ren BigBaseV2.dll YimMenu.dll
|
|
working-directory: bin/Release/
|
|
|
|
- name: Generate Hash for binary
|
|
run: powershell.exe "Get-FileHash YimMenu.dll | Select-Object -ExpandProperty Hash | Out-File sha256.checksum"
|
|
working-directory: bin/Release/
|
|
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: binary
|
|
path: |
|
|
bin/Release/YimMenu.dll
|
|
bin/Release/sha256.checksum
|
|
|
|
- name: Get commit short sha for nightly name
|
|
id: short_sha
|
|
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
|
|
|
create_release:
|
|
runs-on: ubuntu-latest
|
|
name: Create Release
|
|
needs: build-nightly
|
|
steps:
|
|
- name: Download Artifact
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: binary
|
|
|
|
- name: Echo build sha256
|
|
id: build_sha
|
|
run: |
|
|
echo "::set-output name=build_sha::$(sha256sum YimMenu.dll)"
|
|
cat sha256.checksum
|
|
|
|
- name: Nightly Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
name: Nightly [${{ needs.build_nightly.steps.short_sha.outputs.sha_short }}]
|
|
tag_name: nightly
|
|
body: |
|
|
**This release has been build by Github Actions**
|
|
[Link to build](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
|
|
|
|
Build SHA256:
|
|
```
|
|
${{ steps.build_sha.outputs.build_sha }}
|
|
```
|
|
Compare this against the build hash found in the build artifacts, build artifacts can NEVER be modified after they occurred.
|
|
|
|
These are nightly builds of YimMenu, they are provided for testing purposes only:
|
|
- Test if your build environment produces a broken BigBaseV2.dll
|
|
- Test if source code is out of date and no longer compatible with the current version of GTA V
|
|
|
|
If you wish to use this menu as-is you are on your own, no warranty is provided.
|
|
files: |
|
|
YimMenu.dll
|
|
|
|
- name: Keep only latest 3 nightly
|
|
uses: dev-drprasad/delete-older-releases@v0.2.0
|
|
with:
|
|
keep_latest: 3
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|