Skip to content

Commit

Permalink
this should work i think
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-psi authored Jan 10, 2022
1 parent 55f1f4f commit 357c5c8
Showing 1 changed file with 42 additions and 4 deletions.
46 changes: 42 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@

on:
push:
branches:
- main
on: push

jobs:
build:
Expand Down Expand Up @@ -34,3 +31,44 @@ jobs:
uses: actions/upload-artifact@v2
with:
path: output/*
upload-prerelease:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' # Only upload prereleases when it gets merged to main
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Download artifacts
uses: actions/download-artifact@v2
-
name: Get version information
run: |
echo "todayDate=$(date +%Y%m%dT%H%M%SZ)" >> $GITHUB_ENV
-
name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.todayDate }}
release_name: Prerelease ${{ env.todayDate }}
draft: false
prerelease: true
-
name: Attach binaries to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
todayDate: ${{ env.todayDate }}
version: ${{ env.version }}
name: ${{ env.name }}
run: |
set -x
assets=()
for asset in ./artifact/*; do
assets+=("-a" "$asset")
done
hub release edit "${assets[@]}" -m "Prerelease $todayDate" $todayDate

0 comments on commit 357c5c8

Please sign in to comment.