Skip to content

Commit 8234d73

Browse files
committed
refinement: release workflow.
1 parent 800f1f0 commit 8234d73

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed

.github/workflows/release.yml

+8-19
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ jobs:
1010
release:
1111
runs-on: macos-latest
1212

13+
outputs:
14+
version: ${{ steps.get_version.outputs.version }}
15+
upload_url: ${{ steps.create_release.outputs.upload_url }}
16+
1317
steps:
1418
- uses: actions/create-release@v1
1519
env:
@@ -21,12 +25,8 @@ jobs:
2125
prerelease: false
2226
id: create_release
2327

24-
- run: echo "${{ steps.create_release.outputs.upload_url }}" > upload_url.txt
25-
26-
- uses: actions/upload-artifact@v1
27-
with:
28-
name: upload_url
29-
path: upload_url.txt
28+
- id: get_version
29+
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
3030

3131
build:
3232
strategy:
@@ -58,22 +58,11 @@ jobs:
5858
GOARCH: ${{ matrix.target.goarch }}
5959
CGO_ENABLED: 1
6060
61-
- uses: actions/download-artifact@v1
62-
with:
63-
name: upload_url
64-
65-
- id: get_release_info
66-
run: |
67-
echo "##[set-output name=upload_url;]$(cat upload_url/upload_url.txt)"
68-
env:
69-
TAG_REF_NAME: ${{ github.ref }}
70-
REPOSITORY_NAME: ${{ github.repository }}
71-
7261
- uses: actions/upload-release-asset@v1.0.1
7362
env:
7463
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7564
with:
76-
upload_url: ${{ steps.get_release_info.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
65+
upload_url: ${{ needs.release.outputs.upload_url}}
7766
asset_path: ./${{ matrix.target.goos }}-${{ matrix.target.goarch }}${{ matrix.target.ext }}
78-
asset_name: ${{ matrix.target.goos }}-${{ matrix.target.goarch }}${{ matrix.target.ext }}
67+
asset_name: gohack_${{ needs.release.outputs.version }}_${{ matrix.target.goos }}-${{ matrix.target.goarch }}${{ matrix.target.ext }}
7968
asset_content_type: application/zip

0 commit comments

Comments
 (0)