Skip to content

Commit

Permalink
build(release): fix release action
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxcanfly committed Jun 5, 2024
1 parent 6d9cb7a commit 77d1a23
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 18 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
# GitHub considers creating releases and uploading assets as writing contents.
permissions:
contents: write
packages: write

jobs:
goreleaser:
Expand All @@ -25,17 +26,15 @@ jobs:
with:
go-version-file: 'go.mod'
cache: true
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6.1.0
id: import_gpg
- uses: docker/login-action@v3
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
# passphrase: ${{ secrets.PASSPHRASE }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5.0.0
with:
args: release --clean
env:
# GitHub sets the GITHUB_TOKEN secret automatically.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
43 changes: 31 additions & 12 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
# .goreleaser.yaml
signs:
- artifacts: checksum
cmd: gpg2
args:
- "--batch"
- "-u"
- "{{ .Env.GPG_FINGERPRINT }}"
- "--output"
- "${signature}"
- "--detach-sign"
- "${artifact}"
project_name: op-plasma-celestia
builds:
- env: [CGO_ENABLED=0]
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
dockers:
- image_templates: ["ghcr.io/celestiaorg/op-plasma-celestia:{{ .Version }}"]
dockerfile: Dockerfile
build_flag_templates:
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://github.com/tuxcanfly/goreleaser-example
- --label=org.opencontainers.image.source=https://github.com/tuxcanfly/goreleaser-example
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.licenses=MIT
nfpms:
- maintainer: Javed Khan <javed@celestia.org>
description: Celestia Data Availability Provider for Optimism Plasma Protocol.
homepage: https://github.com/tuxcanfly/goreleaser-example
license: MIT
formats:
- deb
- rpm
- apk

0 comments on commit 77d1a23

Please sign in to comment.