Skip to content

Update main.yml

Update main.yml #3

Workflow file for this run

name: Publish SporeModder FX Release
on: push
#workflow_dispatch:
jobs:
build_smfx:
name: Build SporeModder-FX
runs-on: ubuntu-latest
steps:
- name: Checkout SporeModder-FX
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Calculate release version
id: version_number
run: |
version=$( bash calculate_new_version.sh )
echo "version=$version" >> $GITHUB_OUTPUT
- name: Set up JDK 11 for x64
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
architecture: x64
- name: Build with Maven
run: mvn -B -Drevision="${{ steps.version_number.outputs.version }}" package --file pom.xml
- name: Upload build
uses: actions/[email protected]
with:
name: SporeModder-FX-jar
path: shade/sporemodderfx.jar
build_updater:
name: Build Updater
needs: build_smfx
runs-on: ubuntu-latest
steps:
- name: Checkout SporeModder-FX
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout Updater
uses: actions/checkout@v1
with:
repository: emd4600/SporeModder-FX-Updater
ref: main
path: Updater
- name: Update reg_file.txt
run: bash Updater/collect_reg_changes.sh reg_file.txt >> Updater/src/sporemodder/updater/resources/reg_file.txt
- name: Update reg_property.txt
run: bash Updater/collect_reg_changes.sh reg_property.txt >> Updater/src/sporemodder/updater/resources/reg_property.txt
- name: Update reg_type.txt
run: bash Updater/collect_reg_changes.sh reg_type.txt >> Updater/src/sporemodder/updater/resources/reg_type_noforce.txt
- name: Download SporeModderFX.jar
uses: actions/download-artifact@v3
with:
name: SporeModder-FX-jar
path: SporeModder-FX-jar
- name: Copy sporemodderfx.jar
run: cp SporeModder-FX-jar/sporemodderfx.jar Updater/src/sporemodder/updater/resources/SporeModderFX.jar
- name: Set up JDK 11 for x64
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
architecture: x64
- name: Build with Maven
run: cd Updater && mvn -B package --file pom.xml
- run: ls
- run: ls Updater
- run: ls SporeModder-FX-jar
- name: Update release files
run: |
cp reg_cnv.txt "Updater/SporeModder FX/reg_cnv.txt"
cp reg_file.txt "Updater/SporeModder FX/reg_file.txt"
cp reg_property.txt "Updater/SporeModder FX/reg_property.txt"
cp reg_simulator.txt "Updater/SporeModder FX/reg_simulator.txt"
cp reg_simulator_stub.txt "Updater/SporeModder FX/reg_simulator_stub.txt"
cp reg_type.txt "Updater/SporeModder FX/reg_type.txt"
cp sporemodderfx.jar "Updater/SporeModder FX/SporeModderFX.jar"
- name: Generate release zip
run: zip -r "SporeModder FX.zip" "Updater/SporeModder FX"
- name: "Upload build: Updater"
uses: actions/[email protected]
with:
name: SporeModder-FX-Release
path: Updater/shade/SporeModderFX.Updater.jar
- name: "Upload build: Release"
uses: actions/[email protected]
with:
name: SporeModder-FX-Release
path: "SporeModder FX.zip"
publish_release:
name: Publish Release
needs: build_updater
runs-on: ubuntu-latest
steps:
- name: Checkout SporeModder-FX
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate changelog
id: version_number
run: |
git log $(git describe --tags --abbrev=0)..HEAD --oneline --format=%s > changelog.txt
version=$( bash calculate_new_version.sh )
echo "version=$version" >> $GITHUB_OUTPUT
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: SporeModder-FX-jar
- name: Release to GitHub
uses: softprops/action-gh-release@v1
with:
prerelease: true
name: SporeModder FX v${{ steps.version_number.outputs.version }}
tag_name: v${{ steps.version_number.outputs.version }}
body_path: changelog.txt
files: |
sporemodderfx.jar