Skip to content

feat: workflow cli

feat: workflow cli #5

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
env:
GO_VERSION: "1.21"
permissions:
contents: write
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Set up Go 1.x.y
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout codebase
uses: actions/checkout@v3
- name: Test
shell: bash
run: |
make test TEST_FLAGS="-race -covermode=atomic"
test-win:
runs-on: windows-latest
strategy:
fail-fast: false
steps:
- name: Set up Go 1.x.y
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout codebase
uses: actions/checkout@v3
- name: Test
run: |
go mod verify
go mod download
go test -v ./pkg/...
integration-test-ubuntu:
needs: [test, test-win]
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Set up Go 1.x.y
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout codebase
uses: actions/checkout@v3
- name: Test
run: |
make integration_test
goreleaser:
runs-on: ubuntu-latest
needs: integration-test-ubuntu
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}