-
Notifications
You must be signed in to change notification settings - Fork 7
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
1 parent
f6d0288
commit 18c9cc0
Showing
1 changed file
with
38 additions
and
14 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 |
---|---|---|
|
@@ -7,12 +7,40 @@ on: | |
- v[0-9]+.[0-9]+.[0-9]+* | ||
pull_request: | ||
jobs: | ||
release: | ||
name: Create Github Release | ||
if: contains(github.ref, 'tags/v') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
- name: Output Release URL File | ||
run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt | ||
- name: Save Release URL File for publish | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: release_url | ||
path: release_url.txt | ||
|
||
build: | ||
if: contains(github.ref, 'tags/v') | ||
needs: [release] | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [macOS-latest, ubuntu-latest] | ||
steps: | ||
- uses: actions/download-artifact@v1 | ||
with: | ||
name: release_url | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14 | ||
|
@@ -34,26 +62,22 @@ jobs: | |
run: | | ||
make release-darwin | ||
- name: Create Github Release | ||
if: strategy.job-index == 0 | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
- name: Get Release File Name & Upload URL | ||
id: get_release_info | ||
run: | | ||
value=`cat release_url/release_url.txt` | ||
echo ::set-output name=upload_url::$value | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
TAG_REF_NAME: ${{ github.ref }} | ||
REPOSITORY_NAME: ${{ github.repository }} | ||
|
||
- name: Upload Linux | ||
if: matrix.os == 'ubuntu-latest' | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
upload_url: ${{ steps.get_release_info.outputs.upload_url }} | ||
asset_path: build/lyricfier-linux-amd64 | ||
asset_name: lyricfier-linux-amd64 | ||
asset_content_type: application/x-executable | ||
|
@@ -64,7 +88,7 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
upload_url: ${{ steps.get_release_info.outputs.upload_url }} | ||
asset_path: build/lyricfier-windows-amd64.exe | ||
asset_name: lyricfier-windows-amd64.exe | ||
asset_content_type: application/x-dosexec | ||
|
@@ -75,7 +99,7 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
upload_url: ${{ steps.get_release_info.outputs.upload_url }} | ||
asset_path: build/lyricfier-darwin-amd64 | ||
asset_name: lyricfier-darwin-amd64 | ||
asset_content_type: application/x-executable |