Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sc-5117 Add goreleaser #89

Merged
merged 2 commits into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish Release
on:
push:
tags:
- 'v*'

jobs:
release:
name: Create CLI Release on GitHub
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.17

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}

- name: Create Release
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
129 changes: 129 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
project_name: rvasp
dist: dist
builds:
# Define multiple builds as a yaml list, specify by a unique ID
- id: "cmd-rvasp-build"

# Path to project's (sub)directory containing Go code.
dir: .

# Path to main.go file or main package.
main: ./cmd/rvasp

# Binary name (can be a path to wrap binary in a directory)
binary: rvasp

# Custom flags templates
flags:
- -v

# Custom ldflags templates.
ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the cmd/rvasp package have these variables? I think we have to set them in pkg.version?


# Custom environment variables to be set during the build
env:
- CGO_ENABLED=0

# GOOS list to build for
# For more info refer to: https://golang.org/doc/install/source#environment
goos:
- linux
- darwin
- windows

# GOARCH to build for.
# For more info refer to: https://golang.org/doc/install/source#environment
goarch:
- amd64
- "386"
- arm64

# GOARM to build for when GOARCH is arm.
# For more info refer to: https://golang.org/doc/install/source#environment
goarm:
- "6"

# List of combinations of GOOS + GOARCH + GOARM to ignore.
ignore:
- goos: darwin
goarch: 386
- goos: linux
goarch: 386
- goos: windows
goarch: arm64

# Set the modified timestamp on the output binary, typically
# you would do this to ensure a build was reproducible. Pass
# empty string to skip modifying the output.
mod_timestamp: '{{ .CommitTimestamp }}'

# Create .tar.gz and .zip archives
archives:
# tar.gz archive of the binaries
- id: "rvasp-archive-tgz"
format: tar.gz
builds:
- "cmd-rvasp-build"
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
wrap_in_directory: true
files:
- LICENSE
- ./pkg/rvasp/README.md

# Used to validate if downloaded files are correct
checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt'
algorithm: sha256

# Publish the release on GitHub
release:
# Repo in which the release will be created.
# Default is extracted from the origin remote URL or empty if its private hosted.
# Valid options are either github, gitlab or gitea
github:
owner: trisacrypto
name: testnet

# You can change the name of the release.
name_template: 'rVASP v{{.Version}}'

# If set to auto, will mark the release as not ready for production
# in case there is an indicator for this in the tag e.g. v1.0.0-rc1
# If set to true, will mark the release as not ready for production.
prerelease: auto

# Header for the release body.
header: |
[TODO: describe release]
# Footer for the release body.
footer: |
### About
The rVASP tool is a binary command line application that is used to run and
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏽

communicate with "robot VASPs" services for the purposes of demonstrating and
testing sending and receiving transactions using the TRISA InterVASP protocol. This
is mainly intended to be used by TRISA implementers to test integration with the
TRISA TestNet. Full usage documentation is available at
[trisa.dev](https://trisa.dev/testnet/rvasps/).
# If set to true, will not auto-publish the release.
disable: false

changelog:
# Set it to true if you wish to skip the changelog generation.
skip: false

filters:
# Commit messages matching the regexp listed here will be removed from the changelog
exclude:
- (?i)typo
- (?i)^f$
# Dependabot fixes
- (?i)Bump

source:
enabled: true
format: 'zip'
name_template: '{{ .ProjectName }}_v{{ .Version }}_source'

signs:
- artifacts: checksum
args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"]