From 5c4d02008077e25d3e2b391f034e8dca1066d669 Mon Sep 17 00:00:00 2001 From: Richard Jennings Date: Sat, 27 May 2023 10:08:42 +0100 Subject: [PATCH] release --- .github/workflows/golanglint-ci.yml | 19 +++++++++++++++ .github/workflows/release.yml | 37 +++++++++++++++++++++++++++++ .github/workflows/unit-test.yml | 19 +++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 .github/workflows/golanglint-ci.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/unit-test.yml diff --git a/.github/workflows/golanglint-ci.yml b/.github/workflows/golanglint-ci.yml new file mode 100644 index 0000000..7b9d816 --- /dev/null +++ b/.github/workflows/golanglint-ci.yml @@ -0,0 +1,19 @@ +name: golangci-lint + +on: + push: + pull_request: + types: [opened, reopened] +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v3 + with: + go-version: 1.18 + - uses: actions/checkout@v3 + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.46.2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4277016 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +name: goreleaser + +on: + push: + # run only against tags + tags: + - '*' + +permissions: + contents: write + # packages: write + # issues: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - run: git fetch --force --tags + - uses: actions/setup-go@v4 + with: + go-version: stable + # More assembly might be required: Docker logins, GPG, etc. It all depends + # on your needs. + - uses: goreleaser/goreleaser-action@v4 + with: + # either 'goreleaser' (default) or 'goreleaser-pro': + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Your GoReleaser Pro key, if you are using the 'goreleaser-pro' + # distribution: + # GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml new file mode 100644 index 0000000..1b29375 --- /dev/null +++ b/.github/workflows/unit-test.yml @@ -0,0 +1,19 @@ +name: Unit Tests + +on: + push: + pull_request: + types: [opened, reopened] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 2 + - uses: actions/setup-go@v2 + with: + go-version: '1.19' + - name: Run tests + run: go test ./... \ No newline at end of file