forked from kyx0r/FA-Binary-Patches
-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (49 loc) · 1.53 KB
/
upload.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
name: Upload
on:
workflow_dispatch:
inputs:
modName:
description: 'modName'
required: true
default: 'fafdevelop'
type: choice
options:
- fafdevelop
- fafbeta
jobs:
build:
environment: deploy
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
- name: Install MinGW
run: |
pacman --noconfirm -S mingw-w64-i686-gcc
- uses: actions/checkout@v4
- name: Download Patcher
run: curl -L "https://github.com/FAForever/FA_Patcher/releases/latest/download/FaP.exe" -o FaP.exe
- name: Download Baseline
run: curl -L "https://content.faforever.com/build/ForgedAlliance_base.exe" -o ForgedAlliance_base.exe
- name: Patch Binary
run: |
echo '#define gitsha "'${GITHUB_SHA::7}'"' > workflow.cpp
./FaP.exe
- name: Post file
run: curl -f -X "POST"
"https://api.faforever.com/exe/upload" -F "modName=${{ github.event.inputs.modName }}" -F "apiKey=${{ secrets.apiKey }}"
-F "file=@ForgedAlliance_exxt.exe"
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commit: ${{ github.sha }}
tag: ${{ github.event.inputs.modName }}_${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: true