-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hopetree
committed
Apr 2, 2024
1 parent
cc4bd05
commit 990a58e
Showing
3 changed files
with
87 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: go-releaser | ||
|
||
permissions: | ||
contents: write | ||
id-token: write | ||
packages: write | ||
|
||
on: | ||
push: | ||
tags: [ 'v*' ] | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
env: | ||
flags: '' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.21 | ||
cache: true | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean ${{ env.flags }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
project_name: GoMonitor | ||
|
||
before: | ||
hooks: | ||
- go mod tidy | ||
|
||
builds: | ||
- binary: GoMonitor | ||
main: . | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
goarch: | ||
- '386' | ||
- amd64 | ||
- arm | ||
- arm64 | ||
goarm: | ||
- '6' | ||
- '7' | ||
ignore: | ||
- goos: linux | ||
goarch: arm | ||
goarm: '7' | ||
|
||
checksum: | ||
name_template: "checksums.txt" | ||
|
||
archives: | ||
- name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- .Version }}_ | ||
{{- if eq .Os "darwin" }}macos_ | ||
{{- else }}{{ .Os }}_{{ end }} | ||
{{- if eq .Arch "amd64" }}x86_64 | ||
{{- else if eq .Arch "386" }}i386 | ||
{{- else if eq .Arch "arm64" }}aarch64 | ||
{{- else if eq .Arch "arm" }}armv{{ .Arm }} | ||
{{- else }}{{ .Arch }}{{ end }} | ||
wrap_in_directory: true | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
builds_info: | ||
group: root | ||
owner: root | ||
files: | ||
- README.md | ||
- LICENSE | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
|
||
```shell | ||
go mod tidy | ||
bo build | ||
go build | ||
``` | ||
|
||
## 命令使用 | ||
|