Skip to content

Upload

Upload #51

Workflow file for this run

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