Skip to content

Commit

Permalink
docker镜像适配zimaOS
Browse files Browse the repository at this point in the history
  • Loading branch information
matteriot committed Mar 1, 2025
1 parent cd0bcf4 commit e727e8b
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 33 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ^1.20
- uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
- uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Install Snapcraft
run: |
sudo snap install snapcraft --classic
Expand All @@ -44,9 +46,10 @@ jobs:
password: ${{ secrets.MY_GITHUB_TOKEN }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
uses: goreleaser/goreleaser-action@v6
if: startsWith(github.ref, 'refs/tags/')
with:
distribution: goreleaser
version: latest
args: release --clean
env:
Expand Down
91 changes: 61 additions & 30 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,75 @@
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
# you may remove this if you don't use vgo
# - go mod tidy
# - go mod vendor
# You may remove this if you don't use go modules.
- go mod download
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- CGO_ENABLED=0
- GO111MODULE=on
ldflags:
- -s -w -X info.Version={{.Version}} -X info.Commit={{.Commit}} -X info.Date={{ .CommitDate }} -X info.BuiltBy=goreleaser
goos:
- linux
- darwin
- windows
goarch:
- 386
- amd64
- arm
- arm64
- mips64
- mips64le
- mips
- mipsle
gomips:
- hardfloat
- softfloat
ignore:
- goos: darwin
goarch: 386
- env:
- CGO_ENABLED=0
flags:
- -trimpath
goos:
- android
- linux
- windows
- darwin
- freebsd
goarch:
- '386'
- amd64
- arm
- arm64
- mips
- mipsle
- mips64
- mips64le
goarm:
- '5'
- '6'
- '7'
gomips:
- hardfloat
- softfloat
ignore:
# we only need the arm64 build on android
- goos: android
goarch: arm
- goos: android
goarch: '386'
- goos: android
goarch: amd64
ldflags:
- -s -w -X info.Version={{.Version}} -X info.Commit={{.Commit}} -X info.Date={{ .CommitDate }} -X info.BuiltBy=goreleaser

archives:
# use zip for windows archives
- format_overrides:
- goos: windows
format: zip
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}_
{{- .Version }}_
{{- .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Mips }}_{{ .Mips }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
version_template: "{{ incpatch .Version }}-devel"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- '^docs:'
- '^test:'

brews:
- tap:
owner: OpenIoTHub
Expand Down

0 comments on commit e727e8b

Please sign in to comment.