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

122 lines
3.8 KiB
YAML
Raw Normal View History

2022-01-11 13:48:28 +01:00
name: Nightly Build
2022-01-03 17:19:03 +01:00
on:
schedule:
# cronjob that triggers every day at 2PM UTC
- cron: '0 14 * * *'
workflow_dispatch:
concurrency:
group: nightly
cancel-in-progress: true
2022-01-03 17:19:03 +01:00
jobs:
build_nightly:
runs-on: [self-hosted, Windows]
2022-01-03 17:19:03 +01:00
name: Build Nightly
2022-01-11 14:43:35 +01:00
outputs:
full_sha: ${{ steps.var.outputs.full_sha }}
short_sha: ${{ steps.var.outputs.short_sha }}
2022-01-03 17:19:03 +01:00
steps:
2022-11-11 12:34:32 +02:00
- uses: actions/checkout@v3
2022-01-03 17:19:03 +01:00
with:
submodules: recursive
- name: Check CMake version
run: cmake --version
2022-01-03 17:19:03 +01:00
- name: Setup MSVC environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
2022-01-03 17:19:03 +01:00
- name: Generate CMake project
2024-03-12 09:43:08 +01:00
run: cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo -D OPTIMIZE=YES -S. -Bbuild -G Ninja
2022-01-03 17:19:03 +01:00
- name: Build 64bit release DLL
2024-03-12 09:43:08 +01:00
run: cmake --build ./build --config RelWithDebInfo --target YimMenu --
- name: Upload Artifact
2022-11-11 12:34:32 +02:00
uses: actions/upload-artifact@v3
with:
name: binary
2024-03-12 09:43:08 +01:00
path: |
build/YimMenu.dll
build/YimMenu.pdb
2022-01-11 14:43:35 +01:00
- 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
2022-01-11 14:07:40 +01:00
check_date:
runs-on: ubuntu-latest
name: Check latest commit
needs: build_nightly
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
2022-11-11 12:34:32 +02:00
- 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' }}
2022-11-11 12:34:32 +02:00
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, build_nightly ]
if: ${{ needs.check_date.outputs.should_run != 'false' }}
steps:
- uses: actions/checkout@v3
- name: Download Artifact
2022-11-11 12:34:32 +02:00
uses: actions/download-artifact@v3
with:
name: binary
- name: Echo build sha256
id: build_sha
run: |
2022-01-11 14:27:11 +01:00
sha256sum YimMenu.dll > sha256.checksum
2022-11-11 12:34:32 +02:00
echo "build_sha=$(cat sha256.checksum)" >> $GITHUB_OUTPUT
cat sha256.checksum
- name: Run latest-tag
uses: EndBug/latest-tag@84c87607fcb948bcef069c9a27445e653113979f
with:
ref: nightly
- name: Nightly Release
uses: softprops/action-gh-release@v1
2022-01-03 17:19:03 +01:00
with:
2022-01-11 14:43:35 +01:00
name: Nightly [${{ needs.build_nightly.outputs.short_sha }}]
2022-01-11 14:07:40 +01:00
tag_name: nightly
2022-01-03 17:19:03 +01:00
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 }}
```
2022-01-11 16:56:44 +01:00
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.
2022-01-11 14:43:35 +01:00
You can download the build artifacts, generate a SHA256 checksum and compare it with the below binary.
2022-01-11 14:43:35 +01:00
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 YimMenu.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.
2022-01-11 16:56:44 +01:00
Full Commit Hash:
```
${{ needs.build_nightly.outputs.full_sha }}
```
files: |
YimMenu.dll