Skip to content

Commit c198c80

Browse files
committed
add github workflows
1 parent 0dbe286 commit c198c80

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

.github/workflows/release.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
platform: [macos-11, ubuntu-latest]
14+
goarch: [amd64, arm64]
15+
include:
16+
- platform: macos-11
17+
goos: darwin
18+
goarch: arm64
19+
- platform: ubuntu-latest
20+
goos: linux
21+
goarch: amd64
22+
steps:
23+
- name: Set up Go
24+
uses: actions/setup-go@v2
25+
with:
26+
go-version: '^1.17'
27+
28+
- name: Check out code
29+
uses: actions/checkout@v2
30+
31+
- name: Build
32+
run: |
33+
env GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o up_${{ matrix.goos }}_${{ matrix.goarch }}
34+
35+
- name: Upload artifact
36+
uses: actions/upload-artifact@v2
37+
with:
38+
name: up_${{ matrix.goos }}_${{ matrix.goarch }}
39+
path: up_${{ matrix.goos }}_${{ matrix.goarch }}
40+
41+
release:
42+
needs: build
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Download all artifacts
46+
uses: actions/download-artifact@v2
47+
with:
48+
path: artifacts
49+
50+
- name: Create Release
51+
id: create_release
52+
uses: actions/create-release@v1
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
with:
56+
tag_name: ${{ github.ref }}
57+
release_name: Release ${{ github.ref }}
58+
draft: false
59+
prerelease: false
60+
body: "Description of the release"
61+
assets: |
62+
./artifacts/*

0 commit comments

Comments
 (0)