Upload and release #56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |