Skip to content

Commit

Permalink
Create Release workflow
Browse files Browse the repository at this point in the history
Co-authored-by: Charlie Nazario <cnazario@vmware.com>
Co-authored-by: Alex Haldeman <ahaldeman@vmware.com>
  • Loading branch information
3 people committed Mar 25, 2021
1 parent b8bb2c0 commit 8e3c614
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Go
name: CI

on:
push:
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...

release:
name: Create Release
needs: test
runs-on: ubuntu-latest
outputs:
upload_url: ${{steps.create_release.outputs.upload_url}}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
tag_name: ${{github.ref}}
release_name: ${{github.ref}}

build-executable:
name: Build an executable
needs: release
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
- name: Build
run: go build -v -o git-story-view ./cli/main.go
- name: Zip up release
run: tar -zvc git-story-view > ${{github.workspace}}/git-story-darwin-x64.tar.gz
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
upload_url: ${{needs.release.outputs.upload_url}}
asset_path: ./git-story-darwin-x64.tar.gz
asset_name: git-story-darwin-x64.tar.gz
asset_content_type: application/gzip

0 comments on commit 8e3c614

Please sign in to comment.