-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
118 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
*.swo | ||
*.orig | ||
|
||
release/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json | ||
|
||
# This is an example .goreleaser.yml file with some sensible defaults. | ||
# Make sure to check the documentation at https://goreleaser.com | ||
|
||
version: 2 | ||
|
||
builds: | ||
- main: cmd/directorius/main.go | ||
env: | ||
- CGO_ENABLED=0 | ||
flags: | ||
- -trimpath | ||
ldflags: | ||
- "-X main.Version={{ .Version }}" | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
mod_timestamp: '{{ .CommitTimestamp }}' | ||
|
||
archives: | ||
- format: tar.gz | ||
# this name template makes the OS and Arch compatible with the results of `uname`. | ||
name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- title .Os }}_ | ||
{{- if eq .Arch "amd64" }}x86_64 | ||
{{- else if eq .Arch "386" }}i386 | ||
{{- else }}{{ .Arch }}{{ end }} | ||
{{- if .Arm }}v{{ .Arm }}{{ end }} | ||
wrap_in_directory: false | ||
files: | ||
# Do not include README.md and LICENCE file in archive | ||
# (https://goreleaser-git-revert-1958-snapshot-auto.goreleaser.vercel.app/customization/archive/#packaging-only-the-binaries): | ||
- none* | ||
builds_info: | ||
group: 0 | ||
owner: 0 | ||
mode: 0644 | ||
|
||
checksum: | ||
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS" | ||
algorithm: sha256 | ||
signs: | ||
- artifacts: checksum | ||
args: | ||
- "--batch" | ||
- "--pinentry-mode" | ||
- "loopback" | ||
- "--passphrase-fd" | ||
- "0" | ||
- "--local-user" | ||
- "0xC8B381683DBCEDFE" | ||
- "--output" | ||
- "${signature}" | ||
- "--detach-sign" | ||
- "${artifact}" | ||
stdin: '{{ .Env.GPG_PASSWORD }}' | ||
|
||
release: | ||
draft: true | ||
prerelease: auto | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- "^docs:" | ||
- "^test:" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Release | ||
|
||
## How to Create a Release | ||
|
||
1. Create a git tag for the new release | ||
|
||
```sh | ||
git tag v<MY-VERSION> | ||
``` | ||
|
||
**ADVISE**: Do not push the tag. Instead let it be created by GitHub when | ||
removing the draft status. This allows to eventually recreate + delete the | ||
draft release without having the tags already on the on the git remote. | ||
|
||
2. Import our GPG signing private key: | ||
- retrieve the GPG private key password and store it in an environment | ||
variable: | ||
|
||
```sh | ||
export GPG_PASSWORD="$(vault read -field=master-priv-key-password secret/gpg-key-platform)" | ||
``` | ||
|
||
- import the signing key: | ||
|
||
```sh | ||
vault read -field=subkey-signing-priv-key secret/gpg-key-platform | \ | ||
gpg --batch --pinentry-mode loopback --passphrase "$GPG_PASSWORD" --import | ||
``` | ||
|
||
3. Set the `GITHUB_TOKEN` environment variable: | ||
|
||
```sh | ||
export GITHUB_TOKEN=<MY-TOKEN> | ||
``` | ||
|
||
4. Run goreleaser | ||
|
||
```sh | ||
goreleaser release | ||
``` | ||
|
||
5. Review the draft release on GitHub. |