v1.1.0 #13
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 | |
on: | |
release: | |
types: | |
- released | |
jobs: | |
verify_version_number: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- id: get_version | |
name: Get version | |
uses: jannemattila/get-version-from-tag@v1 | |
- name: Verify version number | |
run: | | |
set -e | |
grep -F '"version": "${{ steps.get_version.outputs.version }}"' factorio/info.json | |
grep -F 'VERSION "${{ steps.get_version.outputs.version }}"' mumble/CMakeLists.txt | |
grep -F "<version>${{ steps.get_version.outputs.version }}</version>" mumble/manifest.xml | |
grep -F 'char *VERSION = "${{ steps.get_version.outputs.version }}";' mumble/plugin.c | |
mumble_build: | |
needs: verify_version_number | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
build_type: [Release] | |
c_compiler: [gcc, cl] | |
include: | |
- os: windows-latest | |
c_compiler: cl | |
- os: ubuntu-latest | |
c_compiler: gcc | |
exclude: | |
- os: windows-latest | |
c_compiler: gcc | |
- os: ubuntu-latest | |
c_compiler: cl | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set reusable strings | |
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. | |
id: strings | |
shell: bash | |
run: | | |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | |
echo "build-input-dir=${{ github.workspace }}/mumble" >> "$GITHUB_OUTPUT" | |
- name: Configure CMake | |
run: > | |
cmake -B ${{ steps.strings.outputs.build-output-dir }} | |
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} | |
-S ${{ steps.strings.outputs.build-input-dir }} | |
- name: Build | |
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} | |
- name: Upload a Build Artifact | |
uses: actions/[email protected] | |
with: | |
name: mumble_build | |
path: ${{ steps.strings.outputs.build-output-dir }} | |
mumble_bundle: | |
needs: mumble_build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: mumble_build | |
path: build | |
- name: Bundle | |
run: | | |
mv build/libfactorio_linux_x86_64.so libplugin.so | |
mv build/Release/plugin.dll plugin.dll | |
mv mumble/manifest.xml manifest.xml | |
zip -MM factorio.mumble_plugin manifest.xml libplugin.so plugin.dll | |
- name: Upload a Build Artifact | |
uses: actions/[email protected] | |
with: | |
name: mumble_bundle | |
path: factorio.mumble_plugin | |
mumble_release: | |
needs: mumble_bundle | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get Mumble bundle | |
uses: actions/download-artifact@v3 | |
with: | |
name: mumble_bundle | |
path: mumble_bundle | |
- name: Get release | |
id: get_release | |
uses: bruceadams/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Upload mumble plugin | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: mumble_bundle/factorio.mumble_plugin | |
asset_name: factorio.mumble_plugin | |
asset_content_type: application/zip | |
factorio_bundle: | |
needs: verify_version_number | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- id: get_version | |
name: Get version | |
uses: jannemattila/get-version-from-tag@v1 | |
- name: Bundle | |
run: | | |
cp -r factorio/ proximity-voice-chat/ | |
zip -r proximity-voice-chat_${{ steps.get_version.outputs.version }}.zip proximity-voice-chat | |
- name: Upload a Build Artifact | |
uses: actions/[email protected] | |
with: | |
name: factorio_bundle | |
path: proximity-voice-chat_${{ steps.get_version.outputs.version }}.zip | |
factorio_release: | |
needs: factorio_bundle | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- id: get_version | |
name: Get version | |
uses: jannemattila/get-version-from-tag@v1 | |
- name: Get Factorio bundle | |
uses: actions/download-artifact@v3 | |
with: | |
name: factorio_bundle | |
path: factorio_bundle | |
- name: Get release | |
id: get_release | |
uses: bruceadams/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Upload factorio mod | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: factorio_bundle/proximity-voice-chat_${{ steps.get_version.outputs.version }}.zip | |
asset_name: proximity-voice-chat_${{ steps.get_version.outputs.version }}.zip | |
asset_content_type: application/zip | |
factorio_publish: | |
needs: factorio_release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- id: get_version | |
name: Get version | |
uses: jannemattila/get-version-from-tag@v1 | |
- name: Get Factorio bundle | |
uses: actions/download-artifact@v3 | |
with: | |
name: factorio_bundle | |
path: factorio_bundle | |
- name: Upload to Factorio Mod Portal | |
uses: mchangrh/factorio-mod-upload@v1 | |
with: | |
mod-name: "proximity-voice-chat" | |
env: | |
FACTORIO_MODS_TOKEN: ${{ secrets.FACTORIO_API_KEY }} | |
FILENAME: "./factorio_bundle/proximity-voice-chat_${{ steps.get_version.outputs.version }}.zip" |