62 lines
1.2 KiB
YAML
62 lines
1.2 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- master
|
|
- codex/**
|
|
tags:
|
|
- v*
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: Test
|
|
run: go test ./... -count=1
|
|
|
|
- name: Vet
|
|
run: go vet ./...
|
|
|
|
release-artifacts:
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: Build release packages
|
|
run: |
|
|
VERSION="${GITHUB_REF_NAME:-dev}"
|
|
if [ "$VERSION" = "" ]; then
|
|
VERSION=dev
|
|
fi
|
|
make release VERSION="$VERSION"
|
|
|
|
- name: Upload release artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: netstable-release
|
|
path: |
|
|
dist/*.tar.gz
|
|
dist/checksums.txt
|