Skip to content

fix sporemod prefix

fix sporemod prefix #6

Workflow file for this run

name: Build SpaceStageTimelineFix
on:
push:
branches-ignore:
- 'gh-pages'
tags:
- '*'
pull_request:
workflow_dispatch:
env:
# Build Packages Variables
SPORE_MODDER_FX_TAG: 'v2.2.10'
SPORE_MODDER_FX_FILE: 'SporeModder.FX.zip'
# Build DLLs Variables
SPORE_MOD_API_REF: 'v2.5.326'
SPORE_MOD_API_BUILD_VER: '326'
#Build Sporemod Variables
SPOREMOD_DLLS_BUILD: '2.5.326'
SPOREMOD_PREFIX: 'SpaceStageTimelineFix'
jobs:
build-packages:
name: Build Packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
java-package: 'jre'
- name: Setup SMFX
uses: robinraju/release-downloader@v1
with:
repository: 'emd4600/SporeModder-FX'
tag: ${{ env.SPORE_MODDER_FX_TAG }}
fileName: ${{ env.SPORE_MODDER_FX_FILE }}
tarBall: false
zipBall: false
out-file-path: ''
extract: true
- run: mkdir -p Packages
- name: Build SMFX Project
run: |
cd "SporeModder FX"
java -jar SporeModderFX.jar pack ../Projects/SpaceStageTimelineFix ../Packages/SpaceStageTimelineFix.package
- name: Upload Packages
uses: actions/upload-artifact@v4
with:
name: packages
retention-days: 1
compression-level: 0
path: Packages/*
build-dlls:
name: Build DLLs
runs-on: windows-2022
steps:
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
# Build Spore-ModAPI
- name: Checkout Spore-ModAPI
uses: actions/checkout@v4
with:
repository: 'emd4600/Spore-ModAPI'
ref: ${{ env.SPORE_MOD_API_REF }}
path: 'Spore-ModAPI'
submodules: 'true'
- name: Build Spore ModAPI
run: |
cd Spore-ModAPI
msbuild "Spore ModAPI" /m "/p:Configuration=Release DLL,Platform=x86,SDK_BUILD_VER=${{ env.SPORE_MOD_API_BUILD_VER }},EXECUTABLE_TYPE=2" `
"/p:OutDir=${{ github.workspace }}\coreLibs\" /clp:Summary /v:m
#Build SpaceStageTimelineFix
- name: Checkout SpaceStageTimelineFix
uses: actions/checkout@v4
with:
path: ${{ github.event.repository.name }}
submodules: 'true'
- name: Build SpaceStageTimelineFix
run: |
cd ${{ github.event.repository.name }}
msbuild SpaceStageTimelineFix.sln /m /p:Configuration=Release,Platform=x86 `
"/p:SporeSDKPath=${{ github.workspace }}\Spore-ModAPI\,SporeLuaSdkPath=${{ github.workspace }}\Spore-LuaAPI\,SporeLauncherPath=${{ github.workspace }}\" `
"/p:OutDir=${{ github.workspace }}\coreLibs\" /clp:Summary /v:m
- name: Upload DLL
uses: actions/upload-artifact@v4
with:
name: dll
retention-days: 1
compression-level: 0
path: |
coreLibs/SpaceStageTimelineFix.dll
coreLibs/SpaceStageTimelineFix.pdb
build-sporemod:
name: Build Sporemod
needs: [ build-packages, build-dlls ]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }}/Sporemod
merge-multiple: true
# any tag that doesn't match v.X.X.X (with an optional single character path, eg v1.2.73b) will be marked as experimental
- run: echo "${{ github.ref_name }}" | grep -qE '^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+[[:alpha:]]?$'
id: test_experimental
continue-on-error: true
- run: echo "SPOREMOD_EXPERIMENTAL=${{ steps.test_experimental.outcome != 'success' }}" >> $GITHUB_ENV
- uses: iamazeem/substitute-action@v1
with:
input-files: |
Sporemod/ModInfo.xml
enable-in-place: true
- run: ls ${{ github.workspace }}/Sporemod
- if: ${{ contains(github.ref_type, 'tag') }}
run: echo "SPOREMOD_NAME=${{ env.SPOREMOD_PREFIX }}${{ github.ref_name }}.sporemod" >> $GITHUB_ENV
- if: ${{ ! contains(github.ref_type, 'tag') }}
run: echo "SPOREMOD_NAME=${{ env.SPOREMOD_PREFIX }}${{ github.ref_name }}-$(git rev-parse --short HEAD).sporemod" >> $GITHUB_ENV
- run: echo "DRAFT_RELEASE_NAME=$(echo "${{ github.event.repository.name }} ${{ github.ref_name }}" | tr '-' ' ')" >> $GITHUB_ENV
- name: Create sporemod
uses: thedoctor0/zip-release@0.7.6
with:
type: 'zip'
filename: ${{ env.SPOREMOD_NAME }}
path: 'Sporemod'
custom: '-j -9'
- name: Upload sporemod artifact
uses: actions/upload-artifact@v4
with:
name: sporemod
retention-days: 30
compression-level: 0
path: ${{ env.SPOREMOD_NAME }}
- name: Create draft release
if: ${{ contains(github.ref_type, 'tag') }}
uses: ncipollo/release-action@v1.14.0
with:
draft: true
name: ${{ env.DRAFT_RELEASE_NAME }}
prerelease: ${{ env.SPOREMOD_EXPERIMENTAL }}
makeLatest: true
tag: ${{ github.ref_name }}
artifacts: ${{ env.SPOREMOD_NAME }}