Skip to content
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
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ jobs:
skip-pkg-cache: true
skip-build-cache: true
- run: go run mage.go test
- run: go run mage.go snapshot
if: ${{ matrix.os }} == 'ubuntu-22.04'
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Release"

on:
push:
tags:
- v*

jobs:
build:
name: Release
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: '^1.18.4'
cache: true
- run: go run mage.go release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.envrc

build
dist
27 changes: 27 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
builds:
- main: ./cmd
env:
- CGO_ENABLED=0
targets:
- linux_amd64
- linux_arm64
- darwin_amd64
- darwin_arm64
- windows_amd64
- windows_arm64
archives:
- format_overrides:
- goos: windows
format: zip
release:
mode: append
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
8 changes: 8 additions & 0 deletions magefiles/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ import (
"github.com/magefile/mage/sh"
)

func Snapshot() error {
return sh.RunV("go", "run", fmt.Sprintf("github.com/goreleaser/goreleaser@%s", goReleaserVer), "release", "--snapshot", "--rm-dist")
}

func Release() error {
return sh.RunV("go", "run", fmt.Sprintf("github.com/goreleaser/goreleaser@%s", goReleaserVer), "release", "--rm-dist")
}

func Build() error {
return sh.Run("go", "build", "-o", "build/reassign", "./cmd")
}
Expand Down
1 change: 1 addition & 0 deletions magefiles/versions.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package main

var golangCILintVer = "v1.48.0"
var goReleaserVer = "v1.10.3"
var gosImportsVer = "v0.1.5"