Skip to content

Commit 82c926b

Browse files
committed
reworked release action
1 parent 16d4801 commit 82c926b

File tree

2 files changed

+15
-49
lines changed

2 files changed

+15
-49
lines changed

.github/workflows/new_release_test.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
1-
name: Release
1+
name: Publish Release
22

33
on:
4-
push:
5-
tags:
6-
- 'v*.*.*'
4+
release:
5+
types: [published]
76

87
jobs:
9-
release:
8+
publish_release:
109
name: Publish Release
1110
runs-on: ubuntu-latest
1211
steps:
13-
- name: Get version slug
14-
id: get_version
15-
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
1612
- name: Checkout
1713
uses: actions/checkout@v1
1814
- name: Package
19-
run: tar -cvzf archive-fusionvm-${{ steps.get_version.outputs.VERSION }}.tar.gz archive_fusionvm
20-
- name: GitHub Release
21-
uses: softprops/action-gh-release@v1
22-
with:
23-
# Comma-delimited list of path globs for asset files to upload
24-
files: archive-fusionvm-${{ steps.get_version.outputs.VERSION }}.tar.gz
15+
run: tar -cvzf archive-fusionvm.tar.gz archive_fusionvm
16+
- name: Upload Asset to Release
17+
id: upload_release_asset
18+
uses: actions/[email protected]
2519
env:
2620
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
with:
22+
upload_url: ${{ github.event.release.upload_url }}
23+
asset_path: ./archive-fusionvm.tar.gz
24+
asset_name: archive-fusionvm-${{ github.event.release.tag_name }}.tar.gz
25+
asset_content_type: application/gzip
2726
- name: Bump Homebrew formula
2827
uses: mislav/[email protected]
29-
#if: "!contains(github.ref, '-')" # skip prereleases
28+
if: !github.event.release.prerelease
3029
with:
3130
formula-name: archive-fusionvm
3231
homebrew-tap: nreilingh/homebrew-nreilingh
33-
download-url: https://github.com/NReilingh/archive-fusionvm/releases/download/${{ steps.get_version.outputs.VERSION }}/archive-fusionvm-${{ steps.get_version.outputs.VERSION }}.tar.gz
32+
download-url: ${{ steps.upload_release_asset.outputs.browser_download_url }}
3433
env:
3534
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}

0 commit comments

Comments
 (0)