From 6aa6d997bdc5137d61fc09ab08fdc4c99ca2e0af Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Thu, 9 Nov 2023 00:39:48 +0100 Subject: [PATCH] Integrate publish into build --- .gitea/workflows/love2d-release.yaml | 39 ---------------------- .gitea/workflows/love2d.yaml | 50 ++++++++++++++++++++++++---- 2 files changed, 43 insertions(+), 46 deletions(-) delete mode 100644 .gitea/workflows/love2d-release.yaml diff --git a/.gitea/workflows/love2d-release.yaml b/.gitea/workflows/love2d-release.yaml deleted file mode 100644 index 1d649f5..0000000 --- a/.gitea/workflows/love2d-release.yaml +++ /dev/null @@ -1,39 +0,0 @@ -name: LÖVE Game - Publish - -on: - workflow_call: - inputs: - ITCH_USERNAME: - required: true - ITCH_GAME_ID: - required: true - secrets: - BUTLER_API_KEY: - required: true - -jobs: - Deploy: - name: Upload to Itch - runs-on: ubuntu-latest - - strategy: - fail-fast: true - matrix: - channel: # TODO - - win64 - - love - - name: Deploy - Itch.io ${{ matrix.template }} - steps: - - uses: actions/download-artifact@v3 - with: - name: ${{ matrix.channel }} - path: build/${{ matrix.channel }} - - uses: KikimoraGames/itch-publish@v0.0.3 - with: - butlerApiKey: ${{ secrets.BUTLER_API_KEY }} - gameData: ./build/${{ matrix.template }} - itchUsername: ${{ inputs.ITCH_USERNAME }} - itchGameId: ${{ inputs.ITCH_GAME_ID }} - buildChannel: ${{ matrix.channel }} - buildNumber: ${{ needs.version.outputs.version_hash }} # TODO diff --git a/.gitea/workflows/love2d.yaml b/.gitea/workflows/love2d.yaml index 916a4fc..5b7c832 100644 --- a/.gitea/workflows/love2d.yaml +++ b/.gitea/workflows/love2d.yaml @@ -1,9 +1,17 @@ -name: LÖVE Game - Build +name: LÖVE Game on: workflow_call: inputs: + PUBLISH: + required: true + ITCH_USERNAME: + required: false + ITCH_GAME_ID: + required: false secrets: + BUTLER_API_KEY: + required: false PIPELINE_WORKER_SSH_KEY: required: true PIPELINE_WORKER_KNOWN_HOSTS: @@ -12,7 +20,7 @@ on: required: true jobs: - Package: + package: runs-on: ubuntu-latest steps: - run: apt-get update @@ -37,9 +45,37 @@ jobs: name: "${{ github.event.repository.name }}.love" path: "${{ github.workspace }}/bin/*.love" if-no-files-found: error - - name: Uploading artifacts (win64) - uses: actions/upload-artifact@v3 +# TODO: Fix +# - name: Uploading artifacts (win64) +# uses: actions/upload-artifact@v3 +# with: +# name: "${{ github.event.repository.name }}-win64.zip" +# path: "${{ github.workspace }}/bin/*-win64.zip" +# if-no-files-found: error + deploy: + name: Upload to Itch + runs-on: ubuntu-latest + needs: [package] + if: ${{ input.PUBLISH }} + + strategy: + fail-fast: true + matrix: + channel: # TODO + - love + #- win64 # TODO + + name: Deploy - Itch.io ${{ matrix.template }} + steps: + - uses: actions/download-artifact@v3 with: - name: "${{ github.event.repository.name }}-win64.zip" - path: "${{ github.workspace }}/bin/*-win64.zip" - if-no-files-found: error + name: ${{ matrix.channel }} + path: build/${{ matrix.channel }} + - uses: KikimoraGames/itch-publish@v0.0.3 + with: + butlerApiKey: ${{ secrets.BUTLER_API_KEY }} + gameData: ./build/${{ matrix.template }} + itchUsername: ${{ inputs.ITCH_USERNAME }} + itchGameId: ${{ inputs.ITCH_GAME_ID }} + buildChannel: ${{ matrix.channel }} + buildNumber: ${{ needs.version.outputs.version_hash }} # TODO