Package and commit SporeModder FX Update #54
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: Package and commit SporeModder FX Update | |
on: | |
workflow_dispatch: | |
jobs: | |
build_smfx: | |
name: Build SporeModder-FX | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout SporeModder-FX | |
uses: actions/checkout@v4 | |
with: | |
repository: emd4600/SporeModder-FX | |
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/upload-artifact@v3.1.3 | |
with: | |
name: SporeModder-FX-jar | |
path: shade/sporemodderfx.jar | |
build_updater: | |
name: Build Updater | |
needs: build_smfx | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Updater | |
uses: actions/checkout@v4 | |
with: | |
repository: emd4600/SporeModder-FX-Updater | |
ref: main | |
#- name: Build Updater | |
# run: git clone git@github.com:emd4600/SporeModder-FX-Updater . | |
# env: | |
# NODE_AUTH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
- name: Checkout SporeModder-FX | |
run: git clone https://github.com/emd4600/SporeModder-FX SporeModder-FX | |
- name: Update reg_file.txt | |
run: | | |
echo $'\n' >> src/sporemodder/updater/resources/reg_file.txt | |
bash collect_reg_changes.sh reg_file.txt >> src/sporemodder/updater/resources/reg_file.txt | |
- name: Update reg_property.txt | |
run: | | |
echo $'\n' >> src/sporemodder/updater/resources/reg_property.txt | |
bash collect_reg_changes.sh reg_property.txt >> src/sporemodder/updater/resources/reg_property.txt | |
- name: Update reg_type.txt | |
run: | | |
echo $'\n' >> src/sporemodder/updater/resources/reg_type_noforce.txt | |
bash collect_reg_changes.sh reg_type.txt >> 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 src/sporemodder/updater/resources/SporeModderFX.jar | |
- name: Update release files | |
run: | | |
cp SporeModder-FX/reg_cnv.txt "SporeModder FX/reg_cnv.txt" | |
cp SporeModder-FX/reg_file.txt "SporeModder FX/reg_file.txt" | |
cp SporeModder-FX/reg_property.txt "SporeModder FX/reg_property.txt" | |
cp SporeModder-FX/reg_simulator.txt "SporeModder FX/reg_simulator.txt" | |
cp SporeModder-FX/reg_simulator_stub.txt "SporeModder FX/reg_simulator_stub.txt" | |
cp SporeModder-FX/reg_type.txt "SporeModder FX/reg_type.txt" | |
cp SporeModder-FX-jar/sporemodderfx.jar "SporeModder FX/SporeModderFX.jar" | |
\cp -r SporeModder-FX/Styles "SporeModder FX/Styles" | |
- name: Commit changes to Updater repo | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
#git config user.name github-actions | |
#git config user.email github-actions@github.com | |
#git remote set-url origin git@github.com:emd4600/SporeModder-FX-Updater | |
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 -f src/sporemodder/updater/resources/SporeModderFX.jar | |
git commit -m "Bump updater" | |
git push origin main | |
- name: Push changes to Updater repo | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main |