Skip to content

Commit c3dd06e

Browse files
authored
Merge pull request #91 from Efreak/master
create GitHub action
2 parents 50fb83b + d0abfd6 commit c3dd06e

File tree

2 files changed

+119
-0
lines changed

2 files changed

+119
-0
lines changed

.github/goreleaser.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# .goreleaser.yaml
2+
builds:
3+
# You can have multiple builds defined as a yaml list
4+
-
5+
# ID of the build.
6+
# Defaults to the project name.
7+
id: "my-build"
8+
9+
# Optionally override the matrix generation and specify only the final list of targets.
10+
# Format is `{goos}_{goarch}` with optionally a suffix with `_{goarm}` or `_{gomips}`.
11+
# This overrides `goos`, `goarch`, `goarm`, `gomips` and `ignores`.
12+
targets:
13+
- linux_amd64
14+
- linux_386
15+
- linux_arm_6
16+
- linux_arm_7
17+
- darwin_arm64
18+
- darwin_amd64
19+
- windows_arm
20+
- windows_amd64
21+
- windows_386
22+
23+
# By default, GoRelaser will create your binaries inside `dist/${BuildID}_${BuildTarget}`, which is an unique directory per build target in the matrix.
24+
# You are able to set subdirs within that folder using the `binary` property.
25+
#
26+
# However, if for some reason you don't want that unique directory to be created, you can set this property.
27+
# If you do, you are responsible of keeping different builds from overriding each other.
28+
#
29+
# Defaults to `false`.
30+
#no_unique_dist_dir: true

.github/workflows/go.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: goreleaser
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
goreleaser:
12+
runs-on: ubuntu-latest
13+
steps:
14+
-
15+
name: Checkout
16+
uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 0
19+
-
20+
name: Set up Go
21+
uses: actions/setup-go@v2
22+
with:
23+
go-version: 1.17
24+
-
25+
name: Run GoReleaser
26+
uses: goreleaser/goreleaser-action@v2
27+
with:
28+
# either 'goreleaser' (default) or 'goreleaser-pro'
29+
distribution: goreleaser
30+
version: latest
31+
args: release --rm-dist --config ${{ github.workspace }}/.github/goreleaser.yml
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
35+
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
36+
-
37+
name: Upload artifact dms_linux_amd64
38+
uses: actions/upload-artifact@v2
39+
with:
40+
name: dms_linux_amd64
41+
path: dist/my-build_linux_amd64/dms
42+
-
43+
name: Upload artifact dms_linux_386
44+
uses: actions/upload-artifact@v2
45+
with:
46+
name: dms_linux_386
47+
path: dist/my-build_linux_386/dms
48+
-
49+
name: Upload artifact dms_linux_arm_6
50+
uses: actions/upload-artifact@v2
51+
with:
52+
name: dms_linux_arm_6
53+
path: dist/my-build_linux_arm_6/dms
54+
-
55+
name: Upload artifact dms_linux_arm_7
56+
uses: actions/upload-artifact@v2
57+
with:
58+
name: dms_linux_arm_7
59+
path: dist/my-build_linux_arm_7/dms
60+
-
61+
name: Upload artifact dms_darwin_arm64
62+
uses: actions/upload-artifact@v2
63+
with:
64+
name: dms_darwin_arm64
65+
path: dist/my-build_darwin_arm64/dms
66+
-
67+
name: Upload artifact dms_darwin_amd64
68+
uses: actions/upload-artifact@v2
69+
with:
70+
name: dms_darwin_amd64
71+
path: dist/my-build_darwin_amd64/dms
72+
-
73+
name: Upload artifact dms_windows_arm.exe
74+
uses: actions/upload-artifact@v2
75+
with:
76+
name: dms_windows_arm
77+
path: dist/my-build_windows_arm/dms.exe
78+
-
79+
name: Upload artifact dms_windows_amd64.exe
80+
uses: actions/upload-artifact@v2
81+
with:
82+
name: dms_windows_amd64
83+
path: dist/my-build_windows_amd64/dms.exe
84+
-
85+
name: Upload artifact dms_windows_386.exe
86+
uses: actions/upload-artifact@v2
87+
with:
88+
name: dms_windows_386
89+
path: dist/my-build_windows_386/dms.exe

0 commit comments

Comments
 (0)