1.5.7 changelog #17
Workflow file for this run
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: release | |
# Controls when the workflow will run | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download rfmp | |
uses: robinraju/[email protected] | |
with: | |
repository: JohnTheCoolingFan/rfmp | |
fileName: rfmp-linux | |
latest: true | |
- name: Get full mod file name | |
run: | | |
MFNAME=$(jq -r '.name + "_" + .version + ".zip"' info.json) | |
echo "MODFILENAME=$MFNAME" >> $GITHUB_ENV | |
- name: Pack a mod | |
run: | | |
chmod +x ./rfmp-linux | |
./rfmp-linux --no-clean --install-dir . | |
- name: Upload packed mod as an artifact | |
uses: actions/[email protected] | |
with: | |
name: packed-mod | |
path: ./${{ env.MODFILENAME }} | |
- name: Upload mod name as an artifact | |
uses: actions/[email protected] | |
with: | |
name: info-json | |
path: info.json | |
- name: Post announcement in Discord | |
run: curl -H 'Content-Type'':'' application/json' -d "$(echo '{"username"'':''"'"$(jq -r .name info.json)"'", "content"'':''"'"$(jq -r '"\(.name) \(.version)"' info.json)" has released'"}' | jq)" ${{ secrets.DISCORD_NEW_WEBHOOK }} | |
release-github: | |
name: Release on github | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download mod | |
uses: actions/[email protected] | |
with: | |
name: packed-mod | |
- name: Download info.json | |
uses: actions/[email protected] | |
with: | |
name: info-json | |
- name: Set up environment and file names | |
run: | | |
MFNAME=$(jq -r '.name + "_" + .version + ".zip"' info.json) | |
echo "MODFILENAME=$MFNAME" >> $GITHUB_ENV | |
- name: Upload file to release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ${{ env.MODFILENAME }} | |
release-mod-portal: | |
name: Release on Mod Portal | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download mod | |
uses: actions/[email protected] | |
with: | |
name: packed-mod | |
- name: Download info.json | |
uses: actions/[email protected] | |
with: | |
name: info-json | |
- name: Set up environment and file names | |
run: | | |
MFNAME=$(jq -r '.name + "_" + .version + ".zip"' info.json) | |
echo "MODFILENAME=$MFNAME" >> $GITHUB_ENV | |
- name: Upload file to mod portal | |
run: | | |
UPLOAD_URL=$(curl -X POST -d mod="$(jq -r .name info.json)" -H "Authorization:Bearer ${{ secrets.factorio_token }}" https://mods.factorio.com/api/v2/mods/releases/init_upload | jq -r ".upload_url") | |
curl -X POST -s -F "file=@$MODFILENAME" $UPLOAD_URL |