Skip to content

Commit

Permalink
Merge pull request #6 from cacoco/cacoco/releases
Browse files Browse the repository at this point in the history
add goreleaser configuration
  • Loading branch information
cacoco authored Feb 5, 2024
2 parents f7e2c89 + 73b3f9a commit 66a8fc3
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: goreleaser
"on":
push:
tags:
- "*"
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
66 changes: 66 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

version: 1

project_name: codemetagenerator

before:
hooks:
# You may remove this if you don't use go modules.
Expand All @@ -22,6 +24,19 @@ builds:
- linux
- windows
- darwin
goarch:
- amd64
- arm
- arm64
goarm:
- 7
goamd64:
- v3
mod_timestamp: "{{ .CommitTimestamp }}"

universal_binaries:
- replace: true
mod_timestamp: "{{ .CommitTimestamp }}"

archives:
- format: tar.gz
Expand All @@ -38,9 +53,60 @@ archives:
- goos: windows
format: zip

sboms:
- artifacts: archive

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

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

release:
github:
owner: cacoco
name: codemetagenerator
mode: replace

brews:
# Brew formulas support only one 32-bit version.
- goarm: 7
# GOAMD64 to specify which amd64 version to use if there are multiple
# versions from the build section.
goamd64: v3
url_template: "https://github.com/cacoco/codemetagenerator/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
# Allows you to set a custom download strategy. Note that you'll need
# to implement the strategy and add it to your tap repository.
# Example: https://docs.brew.sh/Formula-Cookbook#specifying-the-download-strategy-explicitly
download_strategy: CurlDownloadStrategy
# Git author used to commit to the repository.
commit_author:
name: goreleaserbot
email: bot@goreleaser.com
# The project name and current git tag are used in the format string.
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"
# Folder inside the repository to put the formula.
folder: Formula
homepage: "https://angstrom.io/codemetagenerator"
description: "A CodeMeta project description generator written in Go."
license: "Apache-2.0"
repository:
# Repository owner.
owner: cacoco
# Repository name.
name: homebrew-tap
# Optionally a branch can be provided.
branch: main
16 changes: 3 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,13 @@ Pull requests are welcome. For major changes, please open an issue first to disc

Please make sure to update tests as appropriate.

## TODOs
1. Actual JSONPath support.
2. Distribute binary via [Homebrew](https://brew.sh/).

## License
[Apache License 2.0](https://spdx.org/licenses/Apache-2.0.html)

Copyright 2024 Christopher Coco

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

0 comments on commit 66a8fc3

Please sign in to comment.