Skip to content

Commit

Permalink
Update goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
k-awata committed Oct 23, 2024
1 parent fe4be8e commit e784034
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 17 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# .github/workflows/release.yml
name: goreleaser

on:
pull_request:
push:
# run only against tags
tags:
Expand All @@ -10,29 +12,31 @@ permissions:
contents: write
# packages: write
# issues: write
# id-token: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: 1.18
go-version: stable
# More assembly might be required: Docker logins, GPG, etc.
# It all depends on your needs.
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v6
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --rm-dist
# 'latest', 'nightly', or a semver
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
25 changes: 18 additions & 7 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com

# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 2

before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...

builds:
- env:
- CGO_ENABLED=0
Expand All @@ -14,15 +23,17 @@ builds:
goarch:
- "386"
- amd64

archives:
- format: zip
replacements:
386: 32-bit
amd64: 64-bit
checksum:
name_template: "checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}-next"
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}64-bit
{{- else if eq .Arch "386" }}32-bit
{{- else }}{{ .Arch }}{{ end }}
changelog:
sort: asc
filters:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/k-awata/rvmbuilder

go 1.18
go 1.23.2

0 comments on commit e784034

Please sign in to comment.