|
1 | | -name: Release |
| 1 | +name: Publish Release |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - tags: |
6 | | - - 'v*.*.*' |
| 4 | + release: |
| 5 | + types: [published] |
7 | 6 |
|
8 | 7 | jobs: |
9 | | - release: |
| 8 | + publish_release: |
10 | 9 | name: Publish Release |
11 | 10 | runs-on: ubuntu-latest |
12 | 11 | steps: |
13 | | - - name: Get version slug |
14 | | - id: get_version |
15 | | - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} |
16 | 12 | - name: Checkout |
17 | 13 | uses: actions/checkout@v1 |
18 | 14 | - 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 | + |
25 | 19 | env: |
26 | 20 | 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 |
27 | 26 | - name: Bump Homebrew formula |
28 | 27 | |
29 | | - #if: "!contains(github.ref, '-')" # skip prereleases |
| 28 | + if: !github.event.release.prerelease |
30 | 29 | with: |
31 | 30 | formula-name: archive-fusionvm |
32 | 31 | 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 }} |
34 | 33 | env: |
35 | 34 | COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }} |
0 commit comments