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
32 changes: 27 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,54 @@ on:
pull_request:
branches: [main]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.24"
go-version-file: go.mod
cache-dependency-path: go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@v7
with:
version: v2.10.1

test:
name: Test
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.24"
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Build package
run: go build ./...

test:
name: Test + Coverage
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Run tests with coverage
run: go test -race -coverprofile=coverage.out -covermode=atomic ./...

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
Expand Down
37 changes: 23 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@ name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
- "v*.*.*"

permissions:
contents: write

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false

jobs:
release:
name: Release
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -20,28 +25,32 @@ jobs:
- name: Generate release notes
id: notes
run: |
# Get the previous tag
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
prev_tag=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || true)

if [ -n "$PREV_TAG" ]; then
echo "Generating changelog from $PREV_TAG to $GITHUB_REF_NAME"
NOTES=$(git log --pretty=format:"- %s" "$PREV_TAG"..HEAD)
if [ -n "$prev_tag" ]; then
echo "Generating changelog from $prev_tag to $GITHUB_REF_NAME"
notes=$(git log --pretty=format:'- %s' "$prev_tag"..HEAD)
else
echo "No previous tag found, using all commits"
NOTES=$(git log --pretty=format:"- %s")
notes=$(git log --pretty=format:'- %s')
fi

{
echo "notes<<EOF"
echo "$NOTES"
echo "$notes"
echo "EOF"
} >> "$GITHUB_OUTPUT"

- name: Create GitHub Release
run: |
gh release create "$GITHUB_REF_NAME" \
--title "$GITHUB_REF_NAME" \
--notes "${{ steps.notes.outputs.notes }}" \
--generate-notes
- name: Create or update GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then
gh release edit "$GITHUB_REF_NAME" \
--title "$GITHUB_REF_NAME" \
--notes "${{ steps.notes.outputs.notes }}"
else
gh release create "$GITHUB_REF_NAME" \
--title "$GITHUB_REF_NAME" \
--notes "${{ steps.notes.outputs.notes }}"
fi
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

Loading