Skip to content

Commit

Permalink
update release creation
Browse files Browse the repository at this point in the history
  • Loading branch information
haverland committed Sep 18, 2022
1 parent b297dee commit 8cb4a2b
Showing 1 changed file with 10 additions and 51 deletions.
61 changes: 10 additions & 51 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,11 @@
name: 'Build'
on:
push:
tags:
- 'v*'
- 'beta-v*'

jobs:
changelog:
runs-on: ubuntu-latest
steps:
- name: "Generate release changelog"
uses: heinrichreimer/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}

create_release:
name: Create Release
runs-on: ubuntu-latest
needs: changelog
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create Release For Tag
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ needs.changelog.outputs.changelog }}
draft: false
prerelease: ${{ contains(github.ref, 'beta') }}

build:
name: Build Executables
needs: create_release
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
Expand Down Expand Up @@ -76,25 +46,14 @@ jobs:
- name: Post-Build for ${{ matrix.os }}
if: ${{ matrix.POST_BUILD_CMD != '' }}
run: ${{ matrix.POST_BUILD_CMD }}
- name: Upload release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: '${{runner.os}}-${{matrix.OUT_FILE_NAME}}'
asset_path: './dist/${{matrix.OUT_FILE_NAME}}'
asset_content_type: ${{ matrix.ASSET_MIME }}

purge_release_if_failed:
name: Delete release if build failed
needs: build
runs-on: ubuntu-latest
if: ${{ failure() || cancelled() }}
steps:
- uses: dev-drprasad/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
delete_release: true
tag_name: ${{ github.ref_name }}
files: './dist/${{matrix.OUT_FILE_NAME}}'
- name: Upload created build on action
uses: actions/upload-artifact@v3
with:
path: './dist/${{matrix.OUT_FILE_NAME}}'
name: '${{runner.os}}-${{matrix.OUT_FILE_NAME}}'

0 comments on commit 8cb4a2b

Please sign in to comment.