Skip to content

Commit

Permalink
Add release pipeline (#5)
Browse files Browse the repository at this point in the history
* Add release pipeline
  • Loading branch information
wrk2bike authored Jan 17, 2020
1 parent 8d794fd commit f9df08c
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 9 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/go-win.yml → .github/workflows/go-build.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
name: Go-Win
name: Build
on:
push:
branches:
- master
pull_request:
branches:
- master
release:
types:
- created

jobs:

build:
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/go-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Make a release with a build artifact and release binary
# when we create a tag
name: Release
on:
push:
tags:
- 'v*'

jobs:
build:
name: Upload Release Asset
runs-on: [windows-latest]
steps:

- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Get dependencies
run: |
go get -v -t -d ./...
- run: mkdir -p build/go

- name: Build
run: |
go build -v -o build/go/terraform-provider-windns.exe
- name: Create Release from Tag
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: Upload Release Asset
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.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
asset_path: build/go/terraform-provider-windns.exe
asset_name: terraform-provider-windns.exe
asset_content_type: application/octet-stream

- name: Upload Built Artifact
uses: actions/upload-artifact@v1
with:
name: terraform-provider-windns.exe
path: build/go/terraform-provider-windns.exe

0 comments on commit f9df08c

Please sign in to comment.