diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 61ed75ac..585bbb61 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -34,17 +34,12 @@ jobs: fetch-depth: 0 lfs: true - - name: Clean Library and Build folder - run: | - rm -rf Library - - - uses: actions/cache@v4 + - name: Cache Unity Library (Speeds up builds) + uses: actions/cache@v3 with: path: Library - key: Library-${{ matrix.unityVersion }}-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} - restore-keys: | - Library-${{ matrix.unityVersion }}-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} - Library- + key: Library-${{ matrix.targetPlatform }} + restore-keys: Library- - name: Debug - List project files run: | @@ -113,7 +108,7 @@ jobs: sha256sum: false publishToItch: - name: Publish itch.io + name: Publish to itch.io runs-on: ubuntu-latest needs: buildForAllSupportedPlatforms strategy: @@ -124,14 +119,14 @@ jobs: steps: - name: Copy build zip to current directory run: | - ls /tmp/zipped_builds - + cp /tmp/zipped_builds/build_${{ matrix.targetPlatform }}.zip ./ + - name: Publish to itch.io - uses: KikimoraGames/itch-publish@v0.0.3 - with: - butlerApiKey: ${{ secrets.BUTLER_API_KEY }} - gameData: /tmp/zipped_builds/build_${{ matrix.targetPlatform }}.zip - itchUsername: ${{ env.ITCH_USERNAME }} - itchGameId: ${{ env.ITCH_GAME_ID }} - buildChannel: ${{ matrix.targetPlatform }} - buildNumber: ${{ needs.buildForAllSupportedPlatforms.outputs.tag.name }} + run: | + export BUTLER_API_KEY=${{ secrets.BUTLER_API_KEY }} + versionArgument="" + if [ "${{ needs.buildForAllSupportedPlatforms.outputs.tag.name }}" != "" ]; then + versionArgument="--userversion ${{ needs.buildForAllSupportedPlatforms.outputs.tag.name }}" + fi + echo "butler push ./build_${{ matrix.targetPlatform }}.zip ${{ env.ITCH_USERNAME }}/${{ env.ITCH_GAME_ID }}:${{ matrix.targetPlatform }} ${versionArgument}" + butler push ./build_${{ matrix.targetPlatform }}.zip ${{ env.ITCH_USERNAME }}/${{ env.ITCH_GAME_ID }}:${{ matrix.targetPlatform }} ${versionArgument}