Skip to content

Commit

Permalink
build step stuff for tags/releases
Browse files Browse the repository at this point in the history
  • Loading branch information
ninjamuffin99 committed Feb 7, 2024
1 parent 69e3d6f commit 60c0054
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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:
Expand Down Expand Up @@ -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/[email protected] # 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

0 comments on commit 60c0054

Please sign in to comment.