2022-01-11 20:48:28 +08:00
|
|
|
name: Nightly Build
|
2022-01-04 00:19:03 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
# cronjob that triggers every day at 2PM UTC
|
|
|
|
- cron: '0 14 * * *'
|
|
|
|
workflow_dispatch:
|
|
|
|
|
2024-02-22 16:34:41 +08:00
|
|
|
concurrency:
|
|
|
|
group: nightly
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-01-04 00:19:03 +08:00
|
|
|
jobs:
|
2024-05-25 05:22:05 +08:00
|
|
|
check_recent_commit:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Check Recent Commit
|
|
|
|
outputs:
|
|
|
|
should_run: ${{ steps.should_run.outputs.should_run }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- id: should_run
|
|
|
|
name: Check if latest commit date is within the previous 24 hours
|
|
|
|
run: |
|
|
|
|
if [ -z "$(git rev-list --since="24 hours ago" --all)" ]; then
|
|
|
|
echo "should_run=false" >> $GITHUB_OUTPUT
|
|
|
|
else
|
|
|
|
echo "should_run=true" >> $GITHUB_OUTPUT
|
|
|
|
fi
|
|
|
|
|
2022-01-11 21:20:49 +08:00
|
|
|
build_nightly:
|
2024-09-28 04:47:41 +08:00
|
|
|
runs-on: windows-latest
|
2022-01-04 00:19:03 +08:00
|
|
|
name: Build Nightly
|
2024-05-25 05:22:05 +08:00
|
|
|
needs: check_recent_commit
|
|
|
|
if: needs.check_recent_commit.outputs.should_run == 'true'
|
2022-01-11 21:43:35 +08:00
|
|
|
outputs:
|
|
|
|
full_sha: ${{ steps.var.outputs.full_sha }}
|
|
|
|
short_sha: ${{ steps.var.outputs.short_sha }}
|
2022-01-04 00:19:03 +08:00
|
|
|
steps:
|
2022-11-11 18:34:32 +08:00
|
|
|
- uses: actions/checkout@v3
|
2022-01-04 00:19:03 +08:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2022-01-11 20:42:01 +08:00
|
|
|
|
2022-11-09 05:08:58 +08:00
|
|
|
- name: Check CMake version
|
|
|
|
run: cmake --version
|
2022-01-04 00:19:03 +08:00
|
|
|
|
2023-02-02 02:49:12 +08:00
|
|
|
- name: Setup MSVC environment
|
|
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
with:
|
|
|
|
arch: amd64
|
2022-01-04 00:19:03 +08:00
|
|
|
|
2022-11-09 05:08:58 +08:00
|
|
|
- name: Generate CMake project
|
2024-03-12 16:43:08 +08:00
|
|
|
run: cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo -D OPTIMIZE=YES -S. -Bbuild -G Ninja
|
2022-01-04 00:19:03 +08:00
|
|
|
|
|
|
|
- name: Build 64bit release DLL
|
2024-03-12 16:43:08 +08:00
|
|
|
run: cmake --build ./build --config RelWithDebInfo --target YimMenu --
|
2022-01-04 00:44:18 +08:00
|
|
|
|
2022-01-11 20:42:01 +08:00
|
|
|
- name: Upload Artifact
|
2022-11-11 18:34:32 +08:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-01-11 20:42:01 +08:00
|
|
|
with:
|
|
|
|
name: binary
|
2024-03-12 16:43:08 +08:00
|
|
|
path: |
|
|
|
|
build/YimMenu.dll
|
|
|
|
build/YimMenu.pdb
|
2022-01-11 20:42:01 +08:00
|
|
|
|
2022-01-11 21:43:35 +08:00
|
|
|
- name: Generate Build Info
|
|
|
|
id: var
|
|
|
|
run: |
|
2022-11-13 01:52:26 +08:00
|
|
|
echo "full_sha=$(git rev-parse HEAD)" >> $env:GITHUB_OUTPUT
|
|
|
|
echo "short_sha=$(git rev-parse --short HEAD)" >> $env:GITHUB_OUTPUT
|
2022-01-11 21:07:40 +08:00
|
|
|
|
2024-05-25 05:22:05 +08:00
|
|
|
recreate_release:
|
2022-07-19 20:38:23 +08:00
|
|
|
runs-on: ubuntu-latest
|
2024-05-25 05:22:05 +08:00
|
|
|
name: Recreate Release
|
2022-07-19 20:38:23 +08:00
|
|
|
needs: build_nightly
|
2024-05-25 05:22:05 +08:00
|
|
|
if: needs.check_recent_commit.outputs.should_run == 'true'
|
2022-07-19 20:38:23 +08:00
|
|
|
steps:
|
2022-11-11 18:34:32 +08:00
|
|
|
- uses: actions/checkout@v3
|
2022-07-19 20:38:23 +08:00
|
|
|
|
2024-05-25 05:22:05 +08:00
|
|
|
- name: Delete Existing Release
|
|
|
|
id: delete_release
|
|
|
|
uses: actions/github-script@v6
|
|
|
|
with:
|
|
|
|
script: |
|
|
|
|
const owner = context.repo.owner;
|
|
|
|
const repo = context.repo.repo;
|
|
|
|
const tag = "nightly";
|
|
|
|
|
|
|
|
// List all releases and find the release by tag
|
|
|
|
const releases = await github.rest.repos.listReleases({
|
|
|
|
owner: owner,
|
|
|
|
repo: repo,
|
|
|
|
});
|
|
|
|
|
|
|
|
const release = releases.data.find(release => release.tag_name === tag);
|
|
|
|
|
|
|
|
// Check if the release exists and delete it
|
|
|
|
if (release) {
|
|
|
|
await github.rest.repos.deleteRelease({
|
|
|
|
owner: owner,
|
|
|
|
repo: repo,
|
|
|
|
release_id: release.id,
|
|
|
|
});
|
|
|
|
console.log(`Deleted release with ID ${release.id}`);
|
|
|
|
} else {
|
|
|
|
console.log("No existing release to delete");
|
|
|
|
}
|
|
|
|
|
|
|
|
// Delete the tag
|
|
|
|
try {
|
|
|
|
await github.rest.git.deleteRef({
|
|
|
|
owner: owner,
|
|
|
|
repo: repo,
|
|
|
|
ref: `tags/${tag}`,
|
|
|
|
});
|
|
|
|
console.log(`Deleted tag ${tag}`);
|
|
|
|
} catch (error) {
|
|
|
|
console.error(`Error deleting tag: ${error.message}`);
|
|
|
|
}
|
2022-07-19 20:38:23 +08:00
|
|
|
|
2022-01-11 20:42:01 +08:00
|
|
|
- name: Download Artifact
|
2022-11-11 18:34:32 +08:00
|
|
|
uses: actions/download-artifact@v3
|
2022-01-11 20:42:01 +08:00
|
|
|
with:
|
|
|
|
name: binary
|
|
|
|
|
|
|
|
- name: Echo build sha256
|
|
|
|
id: build_sha
|
|
|
|
run: |
|
2022-01-11 21:27:11 +08:00
|
|
|
sha256sum YimMenu.dll > sha256.checksum
|
2022-11-11 18:34:32 +08:00
|
|
|
echo "build_sha=$(cat sha256.checksum)" >> $GITHUB_OUTPUT
|
2022-01-11 20:42:01 +08:00
|
|
|
cat sha256.checksum
|
|
|
|
|
2022-01-04 00:44:18 +08:00
|
|
|
- name: Nightly Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
2022-01-04 00:19:03 +08:00
|
|
|
with:
|
2022-01-11 21:43:35 +08:00
|
|
|
name: Nightly [${{ needs.build_nightly.outputs.short_sha }}]
|
2022-01-11 21:07:40 +08:00
|
|
|
tag_name: nightly
|
2022-01-04 00:19:03 +08:00
|
|
|
body: |
|
2023-04-14 05:20:24 +08:00
|
|
|
**This release has been built by Github Actions**
|
2022-01-11 20:42:01 +08:00
|
|
|
[Link to build](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
|
|
|
|
|
|
|
|
Build SHA256:
|
|
|
|
```
|
|
|
|
${{ steps.build_sha.outputs.build_sha }}
|
|
|
|
```
|
2022-01-11 23:56:44 +08: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 21:43:35 +08:00
|
|
|
|
2023-02-02 02:49:12 +08:00
|
|
|
You can download the build artifacts, generate a SHA256 checksum and compare it with the below binary.
|
2022-01-11 21:43:35 +08:00
|
|
|
Build artifacts ARE NOT automatically the same as release assets since release assets can be modified afterwards.
|
|
|
|
|
2022-01-11 20:42:01 +08:00
|
|
|
These are nightly builds of YimMenu, they are provided for testing purposes only:
|
2023-02-02 02:49:12 +08:00
|
|
|
- Test if your build environment produces a broken YimMenu.dll
|
2022-01-11 20:42:01 +08:00
|
|
|
- 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 23:56:44 +08:00
|
|
|
|
|
|
|
Full Commit Hash:
|
|
|
|
```
|
|
|
|
${{ needs.build_nightly.outputs.full_sha }}
|
|
|
|
```
|
2022-01-04 00:44:18 +08:00
|
|
|
files: |
|
2022-01-11 20:42:01 +08:00
|
|
|
YimMenu.dll
|