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
13 changes: 8 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Build
on: [push]

env:
GO_VERSION: "1.24"

jobs:

linting:
Expand All @@ -26,7 +29,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version: ${{ env.GO_VERSION }}

- name: Checkout
uses: actions/checkout@v4
Expand All @@ -50,27 +53,27 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version: "${{ env.GOLANG_VERSION }}"

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Login to Docker Registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Snapshot
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v6
with:
args: release --snapshot

- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v6
with:
args: release --rm-dist
4 changes: 1 addition & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ run:
linters:
enable:
- errcheck
- exportloopref
- gofmt
- copyloopvar
- gosimple
- govet
- ineffassign
Expand All @@ -20,10 +20,8 @@ linters:
- unparam
disable:
- wsl
- maligned
- prealloc
- gochecknoglobals
- scopelint
disable-all: false
presets:
- bugs
Expand Down
6 changes: 6 additions & 0 deletions forge.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
project:
name: align

steps:
build:
help: Build the project
Expand All @@ -12,12 +13,15 @@ steps:
-X 'github.com/gomicro/align/cmd.clientID=$ALIGN_CLIENT_ID'
-X 'github.com/gomicro/align/cmd.clientSecret=$ALIGN_CLIENT_SECRET'"
-o {{.Project}} .

clean:
help: Clean up all generated files
cmd: go clean

lint:
help: Run golangci-lint
cmd: golangci-lint run

install:
help: Install the binary
envs:
Expand All @@ -28,10 +32,12 @@ steps:
"-X 'github.com/gomicro/align/cmd.Version=dev-$(git rev-parse --short HEAD)'
-X 'github.com/gomicro/align/cmd.clientID=$ALIGN_CLIENT_ID'
-X 'github.com/gomicro/align/cmd.clientSecret=$ALIGN_CLIENT_SECRET'"

test:
help: Run all available tests
steps:
- unit test

unit_test:
help: Run the unit tests
cmd: go test ./...
Loading