-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (75 loc) · 2.28 KB
/
release.yml
File metadata and controls
78 lines (75 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Generate release artifacts
on:
workflow_dispatch:
inputs:
release:
description: Add artifacts to release
required: false
default: true
release:
types: [published]
jobs:
latest-tag:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.latesttag.outputs.tag }}
steps:
- uses: actions/checkout@v2.3.3
with:
fetch-depth: 0
- name: Get latest tag
id: latesttag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Print version
run: echo v${{ steps.latesttag.outputs.tag }}
generate:
needs: latest-tag
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.18
- uses: actions/checkout@v2.3.3
- name: Make directory for binaries
run: mkdir bin
- name: Build Windows x86
env:
GOOS: windows
GOARCH: "386"
run: go build -o bin/scold.${{ needs.latest-tag.outputs.tag }}.windows-386.exe ./cmd/scold
- name: Build Windows x86_64
env:
GOOS: windows
GOARCH: amd64
run: go build -o bin/scold.${{ needs.latest-tag.outputs.tag }}.windows-amd64.exe ./cmd/scold
- name: Build Linux x86
env:
GOOS: linux
GOARCH: "386"
run: go build -o bin/scold.${{ needs.latest-tag.outputs.tag }}.linux-386 ./cmd/scold
- name: Build Linux x86_64
env:
GOOS: linux
GOARCH: amd64
run: go build -o bin/scold.${{ needs.latest-tag.outputs.tag }}.linux-amd64 ./cmd/scold
- name: Build Mac OS X
env:
GOOS: darwin
GOARCH: amd64
run: go build -o bin/scold.${{ needs.latest-tag.outputs.tag }}.darwin-amd64 ./cmd/scold
- name: Upload artifacts to job
uses: actions/upload-artifact@v2
with:
name: scold-bin
path: bin/
- name: Create release
uses: Roang-zero1/github-create-release-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifacts to release
uses: Roang-zero1/github-upload-release-artifacts-action@master
with:
args: bin/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}