Split itch upload to separate job - test4

Separated 'packr' gradle task from 'dist' task which builds the JAR
This commit is contained in:
Yair Morgenstern 2023-03-07 21:54:41 +02:00
parent c52d26bbbb
commit a76b344aba
2 changed files with 38 additions and 30 deletions

View File

@ -136,41 +136,21 @@ jobs:
## DESKTOP
- name: Build UncivServer.jar
continue-on-error: true
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
run: |
./gradlew desktop:dist
# Copy JAR for final Github version deploy
cp desktop/build/libs/Unciv.jar deploy/Unciv.jar
- name: Upload JAR
uses: actions/upload-artifact@v3
with:
name: UncivJar
path: desktop/build/libs/Unciv.jar
- name: Unzip zips for steam deployment
continue-on-error: true
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
shell: bash
run: |
mkdir steam
unzip deploy/Unciv-Windows64.zip -d steam/Unciv-Windows64
unzip deploy/Unciv-Linux64.zip -d steam/Unciv-Linux64
# Copy JAR for final Github version deploy
mv desktop/build/libs/Unciv.jar deploy/Unciv.jar
- name: Steam deploy
continue-on-error: true
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: game-ci/steam-deploy@v1
with:
username: ${{ secrets.STEAM_USERNAME }}
password: ${{ secrets.STEAM_PASSWORD }}
configVdf: ${{ secrets.STEAM_CONFIG_VDF}}
ssfnFileName: ${{ secrets.STEAM_SSFN_FILE_NAME }}
ssfnFileContents: ${{ secrets.STEAM_SSFN_FILE_CONTENTS }}
appId: 2118950
buildDescription: ${{steps.tag.outputs.tag}}
rootPath: steam
depot1Path: Unciv-Windows64
depot2Path: Unciv-Linux64
releaseBranch: release
## Server
- name: Build UncivServer.jar
@ -276,3 +256,30 @@ jobs:
wget -q -O jdk-windows-64.zip https://github.com/ojdkbuild/ojdkbuild/releases/download/java-1.8.0-openjdk-1.8.0.232-1.b09/java-1.8.0-openjdk-1.8.0.232-1.b09.ojdkbuild.windows.x86_64.zip
./gradlew desktop:packrWindows64
./butler push deploy/Unciv-Windows64.zip yairm210/unciv:Windows64 --userversion ${{needs.build.outputs.version_tag}}
- name: Unzip zips for steam deployment
continue-on-error: true
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
shell: bash
run: |
mkdir steam
unzip deploy/Unciv-Windows64.zip -d steam/Unciv-Windows64
unzip deploy/Unciv-Linux64.zip -d steam/Unciv-Linux64
- name: Steam deploy
continue-on-error: true
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: game-ci/steam-deploy@v1
with:
username: ${{ secrets.STEAM_USERNAME }}
password: ${{ secrets.STEAM_PASSWORD }}
configVdf: ${{ secrets.STEAM_CONFIG_VDF}}
ssfnFileName: ${{ secrets.STEAM_SSFN_FILE_NAME }}
ssfnFileContents: ${{ secrets.STEAM_SSFN_FILE_CONTENTS }}
appId: 2118950
buildDescription: ${{steps.tag.outputs.tag}}
rootPath: steam
depot1Path: Unciv-Windows64
depot2Path: Unciv-Linux64
releaseBranch: release

View File

@ -94,7 +94,8 @@ for (platform in Platform.values()) {
val platformName = platform.toString()
tasks.create("packr${platformName}") {
dependsOn(tasks.getByName("dist"))
// This task assumes that 'dist' has already been called - does not 'gradle depend' on it
// so we can run 'dist' from one job and then run the packr builds from a different job
// Needs to be here and not in doLast because the zip task depends on the outDir
val jarFile = "$rootDir/desktop/build/libs/${BuildConfig.appName}.jar"