diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5fe95a69..6a42b523 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -162,3 +162,48 @@ jobs: asset_name: ${{ env.OUTPUT_FILE }}.sha256 tag: ${{ github.ref }} overwrite: true + + itch_publish_job: + needs: [build] + if: ${{ startsWith(github.event.ref, 'refs/tags/')}} + + runs-on: ubuntu-latest + + env: + BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }} + + steps: + - name: Install butler + run: | + curl -L -o butler.zip https://broth.itch.zone/butler/linux-amd64/LATEST/archive/default + unzip butler.zip + + chmod +x butler + + ./butler -V + + - name: Download Artifacts + uses: robinraju/release-downloader@v1 + with: + tag: ${{ github.ref }} + fileName: '*.tgz' + out-file-path: downloads-tgz + + - name: Download Artifacts + uses: robinraju/release-downloader@v1 + with: + tag: ${{ github.ref }} + fileName: '*.zip' + out-file-path: downloads-zip + + - name: Upload build + run: | + for file in downloads-tgz/*; do + filename=$(basename -- "$file") + ./butler push "$file" lynix/this-space-of-mine:"${filename%.*}" + done + for file in downloads-zip/*; do + filename=$(basename -- "$file") + ./butler push "$file" lynix/this-space-of-mine:"${filename%.*}" + done +