From 60c00545e95ab832f9d0c3135beee4d3e831a162 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 7 Feb 2024 00:27:10 -0500 Subject: [PATCH] build step stuff for tags/releases --- .github/workflows/build.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60ee2ae..870e922 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,24 +2,23 @@ name: Build Canabalt on: push: - branches: - - main workflow_dispatch: env: BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + RELEASE_TAG: ${{startsWith(github.ref, 'refs/tags/') && github.ref || 'bleeding'}} jobs: create-latest: runs-on: ubuntu-latest steps: - - name: Github Releases Upload + - name: Github Releases Bleeding Upload + if: env.BRANCH_NAME == 'main' uses: marvinpinto/action-automatic-releases@v1.2.1 with: repo_token: "${{ github.token }}" - automatic_release_tag: "bleeding" - prerelease: true - title: "Canabalt Bleeding edge" + automatic_release_tag: "${{env.RELEASE_TAG}}" + prerelease: ${{startsWith(env.RELEASE_TAG, 'bleeding') && 'true' || 'false'}} download_haxe: strategy: matrix: @@ -113,21 +112,20 @@ jobs: ./butler -V - name: Push to itch.io run: | - ./butler push export/*/bin ninja-muffin24/canabalt-hf:${{ matrix.target }} + ./butler push export/*/bin ninja-muffin24/canabalt-hf:${{ matrix.target }}-${{env.RELEASE_TAG}}-${{env.BRANCH_NAME}} shell: bash - name: Get current date id: date run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - run: tar cf - export/${{matrix.target}}/bin/ | gzip > canabalt-${{matrix.target}}-${{ steps.date.outputs.date }}.tar.gz + - run: tar cf - export/${{matrix.target}}/bin/ | gzip > canabalt-${{matrix.target}}-${{ steps.date.outputs.date }}-${{env.BRANCH_NAME}}.tar.gz if: matrix.target == 'linux' - uses: vimtor/action-zip@v1.1 # too lazy to figure out 7z grrr... if: matrix.target != 'linux' with: files: export/${{matrix.target}}/bin/ - dest: canabalt-${{matrix.target}}-${{ steps.date.outputs.date }}.zip + dest: canabalt-${{matrix.target}}-${{ steps.date.outputs.date }}-${{env.BRANCH_NAME}}.zip - name: Upload build to Github releases - if: startsWith(github.ref, 'refs/tags/') env: GITHUB_TOKEN: ${{ github.token }} - run: gh release upload bleeding canabalt-${{matrix.target}}-${{ steps.date.outputs.date }}.* --clobber + run: gh release upload ${{env.RELEASE_TAG}} canabalt-${{matrix.target}}-${{ steps.date.outputs.date }}-${{env.BRANCH_NAME}}.* --clobber shell: bash