-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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}}' | ||
|