This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
YimMenu/.github/workflows/nightly.yml

153 lines
4.9 KiB
YAML

name: Nightly Build
on:
schedule:
# cronjob that triggers every day at 2PM UTC
- cron: '0 14 * * *'
workflow_dispatch:
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@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 /warnaserror
- name: Rename DLL to YimMenu.dll
run: ren BigBaseV2.dll YimMenu.dll
working-directory: bin/Release/
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: binary
path: |
bin/Release/YimMenu.dll
- name: Generate Build Info
id: var
run: |
echo "::set-output name=full_sha::$(git rev-parse HEAD)"
echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
check_detections:
runs-on: ubuntu-latest
name: Check for detections in Binary and notify if necesarry
needs: build_nightly
steps:
- name: Download Artifact
uses: actions/download-artifact@v2
with:
name: binary
- name: Test file for detected bits
id: detections
uses: yimura/gtav-sigscan-action@v0.0.3
with:
file: ./YimMenu.dll
- name: Notify on Discord
if: ${{ steps.detections.outputs.is_detected == 'true' }}
uses: tsickert/discord-webhook@v4.0.0
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
embed-title: YimMenu has been detected by the sigscanner!
embed-description: |
The following bits have been detected:
```yml
${{ steps.detections.outputs.detected_string }}
```
check_date:
runs-on: ubuntu-latest
name: Check latest commit
needs: build_nightly
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"
create_release:
runs-on: ubuntu-latest
name: Create Release
needs: [ check_date, build_nightly ]
if: ${{ needs.check_date.outputs.should_run != 'false' }}
steps:
- name: Download Artifact
uses: actions/download-artifact@v2
with:
name: binary
- name: Echo build sha256
id: build_sha
run: |
sha256sum YimMenu.dll > sha256.checksum
echo "::set-output name=build_sha::$(cat sha256.checksum)"
cat sha256.checksum
- name: Remove previous Nightly
uses: dev-drprasad/delete-tag-and-release@v0.2.0
with:
delete_release: true
tag_name: nightly
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- 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 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 }}
```
To verify the build SHA256 during the action, click the build link, go-to "Create Release", open the Echo build sha256 step and read the sha256.
Compare this build hash with one that you generated yourself from the build artifacts.
Alternatively you can download the build artifacts, generate a SHA256 checksum and compare it with the below binary.
Build artifacts ARE NOT automatically the same as release assets since release assets can be modified afterwards.
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.
Full Commit Hash:
```
${{ needs.build_nightly.outputs.full_sha }}
```
files: |
YimMenu.dll