Publish SporeModder FX Release #20
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: Publish SporeModder FX Release | |
on: | |
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@v4 | |
with: | |
repository: emd4600/SporeModder-FX-Updater | |
#token: ${{ secrets.ACTIONS_GITHUB_TOKEN }} | |
ref: main | |
path: Updater | |
- run: ls | |
- run: ls .. | |
- name: Update registry files | |
run: | | |
bash Updater/collect_reg_changes.sh reg_file.txt >> Updater/src/sporemodder/updater/resources/reg_file.txt | |
bash Updater/collect_reg_changes.sh reg_property.txt >> Updater/src/sporemodder/updater/resources/reg_property.txt | |
bash Updater/collect_reg_changes.sh reg_type.txt >> Updater/src/sporemodder/updater/resources/reg_type_noforce.txt | |
- name: Update style files | |
run: | | |
cp Styles/Default/basic.css Updater/src/sporemodder/updater/resources/Styles/basic.css | |
cp Styles/Default/syntax.css Updater/src/sporemodder/updater/resources/Styles/syntax.css | |
cp Styles/Dark/basic.css Updater/src/sporemodder/updater/resources/Styles/Dark/basic.css | |
cp Styles/Dark/syntax.css Updater/src/sporemodder/updater/resources/Styles/Dark/syntax.css | |
- 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: 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 SporeModder-FX-jar/sporemodderfx.jar "Updater/SporeModder FX/SporeModderFX.jar" | |
\cp -r Styles "Updater/SporeModder FX/Styles" | |
- name: Commit changes to Updater repo | |
run: | | |
cd Updater | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add --all "SporeModder FX" | |
git add src/sporemodder/updater/resources/reg_file.txt | |
git add src/sporemodder/updater/resources/reg_property.txt | |
git add src/sporemodder/updater/resources/reg_type_noforce.txt | |
git add src/sporemodder/updater/resources/Styles/basic.css | |
git add src/sporemodder/updater/resources/Styles/syntax.css | |
git add src/sporemodder/updater/resources/Styles/Dark/basic.css | |
git add src/sporemodder/updater/resources/Styles/Dark/syntax.css | |
git add src/sporemodder/updater/resources/SporeModderFX.jar | |
git commit -m "Bump updater" | |
git push | |
- name: Push changes to Updater repo | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main | |
directory: Updater | |
- name: Generate release zip | |
run: cd Updater && zip -r "SporeModder FX.zip" "SporeModder FX" | |
- 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 | |
- name: Copy updater | |
run: | | |
cp Updater/shade/SporeModderFX.Updater.jar SporeModderFX.Updater.jar | |
cp "Updater/SporeModder FX.zip" "SporeModder FX.zip" | |
- name: "Upload build: Updater" | |
uses: actions/[email protected] | |
with: | |
name: SporeModder-FX-Release | |
path: 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 | |
sed -i -e '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-Release | |
- name: Release to GitHub | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: SporeModder FX v${{ steps.version_number.outputs.version }} | |
tag_name: v${{ steps.version_number.outputs.version }} | |
body_path: changelog.txt | |
files: | | |
SporeModderFX.Updater.jar | |
SporeModder FX.zip |