Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
emilioastarita committed Jun 23, 2020
1 parent f6d0288 commit 18c9cc0
Showing 1 changed file with 38 additions and 14 deletions.
52 changes: 38 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit 18c9cc0

Please sign in to comment.