chore: update workflows and tooling

- update docker actions version
- ghcr login username is repository_owner now
- docker build/push via action now
- add golangci-lint config
- fix Makefile typo
This commit is contained in:
stereomonk
2026-07-03 14:40:33 +03:00
parent 1806b44ad3
commit 01f6790e8b
4 changed files with 45 additions and 32 deletions
+19 -17
View File
@@ -74,8 +74,7 @@ jobs:
dist/copypasta-linux-amd64 \
dist/copypasta-linux-arm64 \
dist/copypasta-win-amd64.exe \
dist/copypasta-win-arm64.exe \
--generate-notes
dist/copypasta-win-arm64.exe
container:
needs: build
@@ -86,26 +85,29 @@ jobs:
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
uses: docker/setup-qemu-action@v4
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v4
- name: Login to GHCR
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
run: |
VERSION=${GITHUB_REF_NAME}
docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg VERSION=${VERSION} \
-t ghcr.io/stereomonk/copypasta:${VERSION} \
-t ghcr.io/stereomonk/copypasta:latest \
--push \
.
- name: docker
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile
platforms: |
linux/amd64
linux/arm64/v8
push: true
tags: |
ghcr.io/stereomonk/copypasta:${{ github.ref_name }}
ghcr.io/stereomonk/copypasta:latest
build-args: |
VERSION=${{ github.ref_name }}
+1 -4
View File
@@ -22,10 +22,6 @@ jobs:
- name: Download dependencies
run: go mod download
- name: Check formatting
run: |
test -z "$(gofmt -l .)"
- name: Build
run: go build ./...
@@ -33,3 +29,4 @@ jobs:
uses: golangci/golangci-lint-action@v9
with:
args: --verbose
+23
View File
@@ -0,0 +1,23 @@
version: "2"
run:
timeout: 5m
linters:
default: standard
enable:
- govet
- staticcheck
- errcheck
- ineffassign
- unused
- misspell
issues:
max-issues-per-linter: 0
max-same-issues: 0
formatters:
enable:
- gofmt
- goimports
+2 -11
View File
@@ -1,5 +1,4 @@
VERSION := $(shell git describe --tags --always)
REGISTRY ?= ghcr.io/stereomonk
build-linux:
mkdir -p dist
@@ -17,19 +16,11 @@ build-windows:
mkdir -p dist
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build \
-trimpath \
-ldflags="-s -w -X main.Version=$(Version)" \
-ldflags="-s -w -X main.Version=$(VERSION)" \
-o dist/copypasta-win-amd64.exe
CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build \
-trimpath \
-ldflags="-s -w -X main.Version=$(Version)" \
-ldflags="-s -w -X main.Version=$(VERSION)" \
-o dist/copypasta-win-arm64.exe
image:
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t $(REGISTRY)/copypasta:$(VERSION) \
--build-arg $(VERSION) \
--push \
.