Skip to content

Commit 3903dd2

Browse files
committed
update
1 parent 0c33605 commit 3903dd2

File tree

3 files changed

+155
-0
lines changed

3 files changed

+155
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: golangci-lint
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches:
7+
- master
8+
- main
9+
pull_request:
10+
permissions:
11+
contents: read
12+
# Optional: allow read access to pull request. Use with `only-new-issues` option.
13+
# pull-requests: read
14+
jobs:
15+
golangci:
16+
name: lint
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: golangci-lint
21+
uses: golangci/golangci-lint-action@v2
22+
with:
23+
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
24+
version: v1.29
25+
26+
# Optional: working directory, useful for monorepos
27+
# working-directory: somedir
28+
29+
# Optional: golangci-lint command line arguments.
30+
# args: --issues-exit-code=0
31+
32+
# Optional: show only new issues if it's a pull request. The default value is `false`.
33+
# only-new-issues: true
34+
35+
# Optional: if set to true then the action will use pre-installed Go.
36+
# skip-go-installation: true
37+
38+
# Optional: if set to true then the action don't cache or restore ~/go/pkg.
39+
# skip-pkg-cache: true
40+
41+
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
42+
# skip-build-cache: true
43+

.github/workflows/goreleaser.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: goreleaser
2+
on:
3+
pull_request:
4+
push:
5+
permissions:
6+
contents: write
7+
jobs:
8+
goreleaser:
9+
runs-on: ubuntu-latest
10+
steps:
11+
-
12+
name: Checkout
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
-
17+
name: Set up Go
18+
uses: actions/setup-go@v2
19+
with:
20+
go-version: 1.17
21+
-
22+
name: Run GoReleaser
23+
uses: goreleaser/goreleaser-action@v2
24+
with:
25+
# either 'goreleaser' (default) or 'goreleaser-pro'
26+
distribution: goreleaser
27+
version: latest
28+
args: release --rm-dist
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
32+
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

.goreleaser.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# .goreleaser.yml
2+
project_name: openAWS
3+
env:
4+
- GO111MODULE=on
5+
before:
6+
hooks:
7+
- go mod tidy
8+
builds:
9+
# You can have multiple builds defined as a yaml list
10+
-
11+
# ID of the build.
12+
# Defaults to the project name.
13+
#id: "my-build"
14+
15+
# Path to project's (sub)directory containing Go code.
16+
# This is the working directory for the Go build command(s).
17+
# Default is `.`.
18+
#dir: go
19+
20+
# Path to main.go file or main package.
21+
# Notice: when used with `gomod.proxy`, this must be a package.
22+
#
23+
# Default is `.`.
24+
#main: ./cmd/my-app
25+
26+
# Binary name.
27+
# Can be a path (e.g. `bin/app`) to wrap the binary in a directory.
28+
# Default is the name of the project directory.
29+
#binary: program
30+
31+
# Custom flags templates.
32+
# Default is empty.
33+
#flags:
34+
# - -tags=dev
35+
# - -v
36+
37+
# Custom asmflags templates.
38+
# Default is empty.
39+
#asmflags:
40+
# - -D mysymbol
41+
# - all=-trimpath={{.Env.GOPATH}}
42+
43+
# Custom gcflags templates.
44+
# Default is empty.
45+
#gcflags:
46+
# - all=-trimpath={{.Env.GOPATH}}
47+
# - ./dontoptimizeme=-N
48+
49+
# Custom ldflags templates.
50+
# Default is `-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser`.
51+
ldflags:
52+
- -s -w
53+
- -X github.com/hacker65536/openAWS/cmd.Version={{.Version}}
54+
- -X github.com/hacker65536/openAWS/cmd.GitCommit={{.ShortCommit}}
55+
env:
56+
- CGO_ENABLED=0
57+
58+
# GOARCH to build for.
59+
# For more info refer to: https://golang.org/doc/install/source#environment
60+
# Defaults are 386, amd64 and arm64.
61+
goarch:
62+
- amd64
63+
- arm
64+
- arm64
65+
66+
67+
# Optionally override the matrix generation and specify only the final list of targets.
68+
# Format is `{goos}_{goarch}` with optionally a suffix with `_{goarm}` or `_{gomips}`.
69+
# This overrides `goos`, `goarch`, `goarm`, `gomips` and `ignores`.
70+
targets:
71+
- linux_amd64
72+
- darwin_arm64
73+
- darwin_amd64
74+
- linux_arm_6
75+
76+
77+
# If true, skip the build.
78+
# Useful for library projects.
79+
# Default is false
80+
skip: false

0 commit comments

Comments
 (0)