Skip to content

Commit f9df08c

Browse files
authored
Add release pipeline (#5)
* Add release pipeline
1 parent 8d794fd commit f9df08c

File tree

2 files changed

+62
-9
lines changed

2 files changed

+62
-9
lines changed
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
name: Go-Win
1+
name: Build
22
on:
33
push:
4-
branches:
5-
- master
6-
pull_request:
7-
branches:
8-
- master
9-
release:
10-
types:
11-
- created
4+
125
jobs:
136

147
build:

.github/workflows/go-release.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Make a release with a build artifact and release binary
2+
# when we create a tag
3+
name: Release
4+
on:
5+
push:
6+
tags:
7+
- 'v*'
8+
9+
jobs:
10+
build:
11+
name: Upload Release Asset
12+
runs-on: [windows-latest]
13+
steps:
14+
15+
- name: Set up Go 1.13
16+
uses: actions/setup-go@v1
17+
with:
18+
go-version: 1.13
19+
id: go
20+
21+
- name: Check out code into the Go module directory
22+
uses: actions/checkout@v1
23+
24+
- name: Get dependencies
25+
run: |
26+
go get -v -t -d ./...
27+
28+
- run: mkdir -p build/go
29+
30+
- name: Build
31+
run: |
32+
go build -v -o build/go/terraform-provider-windns.exe
33+
34+
- name: Create Release from Tag
35+
id: create_release
36+
uses: actions/create-release@v1.0.0
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
with:
40+
tag_name: ${{ github.ref }}
41+
release_name: Release ${{ github.ref }}
42+
draft: false
43+
prerelease: false
44+
45+
- name: Upload Release Asset
46+
id: upload-release-asset
47+
uses: actions/upload-release-asset@v1.0.1
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
with:
51+
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
52+
asset_path: build/go/terraform-provider-windns.exe
53+
asset_name: terraform-provider-windns.exe
54+
asset_content_type: application/octet-stream
55+
56+
- name: Upload Built Artifact
57+
uses: actions/upload-artifact@v1
58+
with:
59+
name: terraform-provider-windns.exe
60+
path: build/go/terraform-provider-windns.exe

0 commit comments

Comments
 (0)