Skip to content

Commit

Permalink
feat: move to releaser
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyvalynko-int committed Jan 22, 2024
1 parent 05098b8 commit a338fe2
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 179 deletions.
19 changes: 0 additions & 19 deletions .github/builder/Dockerfile

This file was deleted.

60 changes: 0 additions & 60 deletions .github/builder/README.MD

This file was deleted.

77 changes: 0 additions & 77 deletions .github/builder/entrypoint.sh

This file was deleted.

47 changes: 24 additions & 23 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,33 @@ on:
tags:
- v*
jobs:
build:
name: Build
goreleaser:
name: Build and publish to registry
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v1
- uses: ./.github/builder
- uses: actions/upload-artifact@v1
- name: Checkout
uses: actions/checkout@v2

- name: Unshallow
run: git fetch --prune --unshallow

- name: Set up Go
uses: actions/setup-go@v2
with:
name: binaries
path: .release
publish:
name: Publish
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/download-artifact@v1
go-version: 1.16

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
name: binaries
path: .release
- name: github-upload-release
uses: docker://moonswitch/github-upload-release:master
gpg_private_key: ${{ secrets.BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.BOT_GPG_PASSPHRASE }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: not actor nektos/act

52 changes: 52 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Visit https://goreleaser.com for documentation on how to customize this
# behavior.
# Modified from https://raw.githubusercontent.com/hashicorp/terraform-provider-scaffolding/master/.goreleaser.yml
builds:
- env:
# goreleaser does not work with CGO, it could also complicate
# usage by users in CI/CD systems like Terraform Cloud where
# they are unable to install libraries.
- CGO_ENABLED=0
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath
ldflags:
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
goos:
- windows
- linux
- darwin
goarch:
- amd64
- '386'
- arm
- arm64
ignore:
- goos: darwin
goarch: '386'
- goos: windows
goarch: 'arm64'
binary: '{{ .ProjectName }}_v{{ .Version }}'
archives:
- format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
signs:
- artifacts: checksum
args:
# if you are using this is a GitHub action or some other automated pipeline, you
# need to pass the batch flag to indicate its not interactive.
- "--batch"
- "--local-user"
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
- "--output"
- "${signature}"
- "--detach-sign"
- "${artifact}"
release:
# If you want to manually examine the release before its live, uncomment this line:
# draft: true
changelog:
skip: true

0 comments on commit a338fe2

Please sign in to comment.