From b5a2c9dad417ebecdf291859a26449472759059b Mon Sep 17 00:00:00 2001 From: Alexey Vasiliev Date: Sat, 6 Jul 2024 02:41:05 +0300 Subject: [PATCH] install lib postal --- .github/workflows/build-and-release.yml | 15 ++++- .goreleaser.linux.yml | 81 ++++++++++++++++++++++++ .goreleaser.yml => .goreleaser.macos.yml | 5 -- 3 files changed, 95 insertions(+), 6 deletions(-) create mode 100644 .goreleaser.linux.yml rename .goreleaser.yml => .goreleaser.macos.yml (94%) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 74a377a..062a3df 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -91,10 +91,23 @@ jobs: - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 + if: ${{ matrix.os == 'ubuntu-latest' }} + # if: success() && startsWith(github.ref, 'refs/tags/') + with: + version: latest + args: release --clean --skip=publish --snapshot -f .goreleaser.linux.yml + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} + # GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + if: ${{ matrix.os == 'macos-latest' }} # if: success() && startsWith(github.ref, 'refs/tags/') with: version: latest - args: release --clean --skip=publish --snapshot + args: release --clean --skip=publish --snapshot -f .goreleaser.macos.yml # env: # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} diff --git a/.goreleaser.linux.yml b/.goreleaser.linux.yml new file mode 100644 index 0000000..3112b1a --- /dev/null +++ b/.goreleaser.linux.yml @@ -0,0 +1,81 @@ +# This is an example .goreleaser.yml file with some sane defaults. +# Make sure to check the documentation at http://goreleaser.com +builds: + - id: postal-server-build + binary: postal_server + env: + - CGO_ENABLED=1 + goos: + - linux + goarch: + - "386" + - amd64 + - arm + - arm64 + goarm: + - "7" + flags: + - -trimpath + ldflags: + - -s -w + - -X github.com/le0pard/postal_server/version.Version={{.Version}} + - -X github.com/le0pard/postal_server/version.GitCommit={{.Commit}} + - -X github.com/le0pard/postal_server/version.BuildTime={{.Date}} + +archives: + - id: postal-server-archive + builds: + - postal-server-build + name_template: >- + postal_server_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + format_overrides: + - goos: windows + format: zip + +checksum: + name_template: 'checksums.txt' + +# snapshot: +# name_template: "{{ .Tag }}" + +# signs: +# - artifacts: checksum +# args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"] + +sboms: + - artifacts: archive + +# changelog: +# sort: asc +# use: github +# filters: +# exclude: +# - '^docs:' +# - '^test:' + +# brews: +# - +# name: certonid +# ids: +# - certonid-archive +# goarm: "7" +# # GitHub/GitLab repository to push the formula to +# repository: +# owner: certonid +# name: homebrew-tap +# branch: main +# token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" + +# commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}" +# directory: Formula +# homepage: "https://github.com/certonid/certonid" +# description: "Serverless SSH Certificate Authority" +# license: "MIT" +# test: | +# system "#{bin}/certonid", "--version" +# install: | +# bin.install "certonid" diff --git a/.goreleaser.yml b/.goreleaser.macos.yml similarity index 94% rename from .goreleaser.yml rename to .goreleaser.macos.yml index 1a83a8e..0127fce 100644 --- a/.goreleaser.yml +++ b/.goreleaser.macos.yml @@ -6,12 +6,7 @@ builds: env: - CGO_ENABLED=1 goos: - {{- if eq .Os "linux" }} - - linux - {{- end }} - {{- if eq .Os "darwin" }} - darwin - {{- end }} goarch: - "386" - amd64