-
Notifications
You must be signed in to change notification settings - Fork 5
69 lines (57 loc) · 1.9 KB
/
GenPatches.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: "Generate Patches"
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Check for [NOBUILD] in commit message"
id: nobuild_check
run: |
if [[ "${{ github.event.head_commit.message }}" == *"[NOBUILD]"* ]]; then
echo "NOBUILD flag detected, stopping workflow."
exit 1
fi
- name: "Setup Python"
uses: actions/[email protected]
with:
python-version: 3.12.0
architecture: x64
- run: python3 Scripts/pchtxt2ips.py batch Patches Out
- name: "Create dynamic tag name"
id: create_tag
run: |
# Generate a tag name based on the date and short commit hash
TAG_NAME="v$(date +'%Y%m%d')-$(git rev-parse --short HEAD)"
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
- name: "Create zip of IPS files"
run: |
mkdir -p tmp/atmosphere/exefs_patches/fortpatcher
cp Out/*.ips tmp/atmosphere/exefs_patches/fortpatcher/
cd tmp && zip -r ../Out/all_patches.zip atmosphere
- name: "Create GitHub release"
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{github.token}}
with:
tag_name: ${{ env.TAG_NAME }}
release_name: Release ${{ env.TAG_NAME }}
draft: false
prerelease: false
- name: "Upload individual IPS files to release"
env:
GITHUB_TOKEN: ${{github.token}}
run: |
for file in Out/*.ips; do
gh release upload ${{ env.TAG_NAME }} "$file" --clobber
done
- name: "Upload zip file to release"
run: gh release upload ${{ env.TAG_NAME }} Out/all_patches.zip --clobber
env:
GITHUB_TOKEN: ${{github.token}}