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
45 changes: 14 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,25 @@
name: CI

on:
push:
branches: [main]
tags: ['*']
pull_request:
branches:
- main
branches: [main]

jobs:
test:
name: Test
runs-on: ubuntu-latest
ci:
name: Lint & Test
if: >
github.event_name == 'push' ||
github.actor == 'jasoet'
runs-on: [self-hosted, local, macOS, ARM64]
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.26'
check-latest: true
- name: Lint
run: nix develop --command golangci-lint run ./...

- name: Run tests
run: go test -race -count=1 ./... -tags=!examples

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.26'
check-latest: true

- name: Install golangci-lint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.11.3

- name: Run lint
run: golangci-lint run ./...
- name: Test
run: nix develop --command go test -race -count=1 ./... -tags=!examples
37 changes: 8 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,26 @@ name: Release

on:
push:
branches:
- main
branches: [main]
workflow_dispatch:

jobs:
test:
name: Test
runs-on: ubuntu-latest
runs-on: [self-hosted, local, macOS, ARM64]
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.26'
check-latest: true

- name: Run tests
run: go test -race -count=1 ./... -tags=!examples
- name: Test
run: nix develop --command go test -race -count=1 ./... -tags=!examples

release:
name: Release
needs: test
runs-on: ubuntu-latest
runs-on: [self-hosted, local, macOS, ARM64]
permissions:
contents: write
issues: write
Expand All @@ -39,27 +32,13 @@ jobs:
fetch-depth: 0
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.26'
check-latest: true

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22'

- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Install semantic-release
run: bun install -g semantic-release @semantic-release/github conventional-changelog-conventionalcommits
run: nix develop --command bun install -g semantic-release @semantic-release/github conventional-changelog-conventionalcommits

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bunx semantic-release
run: nix develop --command bunx semantic-release

- name: Warm Go module proxy
if: success()
Expand All @@ -68,5 +47,5 @@ jobs:
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [ -n "$LATEST_TAG" ]; then
echo "Warming Go proxy for github.com/jasoet/pkg/v2@${LATEST_TAG}"
GOPROXY=https://proxy.golang.org GO111MODULE=on go list -m "github.com/jasoet/pkg/v2@${LATEST_TAG}" || true
GOPROXY=https://proxy.golang.org GO111MODULE=on nix develop --command go list -m "github.com/jasoet/pkg/v2@${LATEST_TAG}" || true
fi
Loading