From 1072e3c383eee052116b08bf20f735c6f39f88f7 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Sun, 26 Feb 2023 12:16:38 +0800 Subject: [PATCH] Goreleaser build nightlies (#27) Reviewed-on: https://gitea.com/gitea/act_runner/pulls/27 --- .gitea/workflows/release-nightly.yml | 23 +++++++ .goreleaser.yaml | 92 ++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 .gitea/workflows/release-nightly.yml create mode 100644 .goreleaser.yaml diff --git a/.gitea/workflows/release-nightly.yml b/.gitea/workflows/release-nightly.yml new file mode 100644 index 0000000..ad92fdb --- /dev/null +++ b/.gitea/workflows/release-nightly.yml @@ -0,0 +1,23 @@ +name: goreleaser + +on: + push: + branches: [ main ] + tags-ignore: [ '**' ] # skip building on tags + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: https://github.com/goreleaser/goreleaser-action@v4 + with: + distribution: goreleaser-pro + version: latest + args: release --nightly --clean + env: + GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} + S3_BUCKET: ${{ secrets.S3_BUCKET }} + S3_REGION: ${{ secrets.AWS_REGION }} + AWS_KEY_ID: ${{ secrets.AWS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..583c64d --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,92 @@ +before: + hooks: + - go mod tidy + +builds: +- env: + - CGO_ENABLED=0 + goos: + - darwin + - linux + - windows + - freebsd + goarch: + - amd64 + - arm + - arm64 + - s390x + - ppc64le + goarm: + - "5" + - "6" + - "7" + ignore: + - goos: darwin + goarch: arm + - goos: darwin + goarch: ppc64le + - goos: darwin + goarch: s390x + - goos: windows + goarch: ppc64le + - goos: windows + goarch: s390x + - goos: windows + goarch: arm + goarm: "5" + - goos: windows + goarch: arm + goarm: "6" + - goos: windows + goarch: arm + goarm: "7" + - goos: freebsd + goarch: ppc64le + - goos: freebsd + goarch: s390x + - goos: freebsd + goarch: arm + goarm: "5" + - goos: freebsd + goarch: arm + goarm: "6" + - goos: freebsd + goarch: arm + goarm: "7" + flags: + - -trimpath + ldflags: + - -s -w + binary: >- + {{ .ProjectName }}- + {{- if .IsSnapshot }}{{ .Branch }}- + {{- else }}{{- .Version }}-{{ end }} + {{- .Os }}- + {{- if eq .Arch "amd64" }}amd64 + {{- else if eq .Arch "amd64_v1" }}amd64 + {{- else if eq .Arch "386" }}386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}-{{ .Arm }}{{ end }} + no_unique_dist_dir: true + +blobs: + - + provider: s3 + bucket: "{{ .Env.S3_BUCKET }}" + region: "{{ .Env.S3_REGION }}" + folder: "act_runner/{{.Version}}" + +archives: + - format: binary + name_template: "{{ .Binary }}" + allow_different_binary_count: true + +checksum: + name_template: 'checksums.txt' + +snapshot: + name_template: "{{ incpatch .Version }}" + +nightly: + publish_release: false + name_template: "{{ .Branch }}" \ No newline at end of file