Skip to content

Commit

Permalink
update Depfile goreleaser & golangci-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
gertd committed Sep 13, 2023
1 parent 44c3d62 commit 7af8342
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 34 deletions.
54 changes: 27 additions & 27 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
-
-
uses: actions/checkout@v3
-
-
name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
-
-
name: Setup caching
uses: actions/cache@v3
with:
Expand All @@ -42,26 +42,26 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
-
name: Build
run: |
go build -o ./bin/topaz ./cmd/topaz/
go build -o ./bin/topazd ./cmd/topazd/
-
-
name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.2
-
-
name: Test Setup
uses: autero1/action-gotestsum@v2.0.0
with:
gotestsum_version: 1.10.0
-
-
name: Test
run: |
gotestsum --format short-verbose -- -count=1 -v -timeout=240s -coverprofile=cover.out -coverpkg=./... ./...
-
-
name: Upload code coverage
uses: shogo82148/actions-goveralls@v1
continue-on-error: true
Expand All @@ -73,7 +73,7 @@ jobs:
# always push when ref is a tag
if: github.event_name == 'push' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/heads/dev-') || startsWith(github.ref, 'refs/tags/v') )
steps:
-
-
name: Read Configuration
uses: hashicorp/vault-action@v2.5.0
id: vault
Expand All @@ -85,16 +85,16 @@ jobs:
kv/data/github "USERNAME" | DOCKER_USERNAME;
kv/data/github "DOCKER_PUSH_TOKEN" | DOCKER_PASSWORD;
kv/data/github "READ_WRITE_TOKEN" | READ_WRITE_TOKEN;
-
-
uses: actions/checkout@v3
with:
fetch-depth: 0
-
-
name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
-
-
name: Setup caching
uses: actions/cache@v3
with:
Expand All @@ -106,15 +106,15 @@ jobs:
${{ runner.os }}-go-
-
name: Setup QEMU
uses: docker/setup-qemu-action@v2
-
uses: docker/setup-qemu-action@v2
-
name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v2
with:
registry: https://ghcr.io
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
-
-
name: Docker SSH Setup
run: |
mkdir -p $HOME/.ssh
Expand All @@ -125,35 +125,35 @@ jobs:
git config --global user.name "Aserto Bot"
eval `ssh-agent`
ssh-add $HOME/.ssh/id_rsa
-
-
name: Wait for tests to succeed
uses: fountainhead/action-wait-for-check@v1.1.0
id: wait-for-tests
with:
token: ${{ env.READ_WRITE_TOKEN }}
checkName: test
ref: ${{ github.event.pull_request.head.sha || github.sha }}
-
-
name: Stop if tests fail
if: steps.wait-for-tests.outputs.conclusion != 'success'
run: exit 1
-
-
name: Push image to GitHub Container Registry
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: v1.18.2
args: release --clean --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release:
needs: [test, push]
runs-on: ubuntu-latest
# Only release when ref is a tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
-
-
name: Read Configuration
uses: hashicorp/vault-action@v2.5.0
id: vault
Expand All @@ -167,16 +167,16 @@ jobs:
kv/data/github "READ_WRITE_TOKEN" | READ_WRITE_TOKEN;
kv/data/github "ASERTO_TAP" | ASERTO_TAP;
kv/data/gcp "SERVICE_ACCOUNT_GITHUB_ACTIONS_RELEASE" | SERVICE_ACCOUNT_GITHUB_ACTIONS_RELEASE;
-
-
uses: actions/checkout@v3
with:
fetch-depth: 0
-
-
name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
-
-
name: Setup caching
uses: actions/cache@v3
with:
Expand All @@ -188,8 +188,8 @@ jobs:
${{ runner.os }}-go-
-
name: Setup QEMU
uses: docker/setup-qemu-action@v2
-
uses: docker/setup-qemu-action@v2
-
name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v2
with:
Expand All @@ -215,7 +215,7 @@ jobs:
name: Write Version Info
run: |
git describe --tags > VERSION.txt
-
-
name: Release
uses: goreleaser/goreleaser-action@v4
env:
Expand All @@ -226,7 +226,7 @@ jobs:
distribution: goreleaser
version: v1.18.2
args: release --clean

msi:
needs: release
runs-on: windows-latest
Expand Down
7 changes: 3 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ builds:
archives:
# https://goreleaser.com/customization/archive/
- format: zip
rlcp: true
builds:
- topaz
- topazd
Expand All @@ -68,7 +67,7 @@ archives:
- README.md
name_template: >-
topaz_{{ .Os }}_{{- if eq .Arch "amd64" }}x86_64{{- else }}{{ .Arch }}{{ end }}
checksum:
# https://goreleaser.com/customization/checksum/
name_template: "checksums.txt"
Expand Down Expand Up @@ -119,7 +118,7 @@ brews:
-
name: topaz

tap:
repository:
owner: "{{ .Env.ORG }}"
name: homebrew-tap
token: "{{ .Env.ASERTO_TAP }}"
Expand Down Expand Up @@ -163,7 +162,7 @@ dockers:
- "--label=org.opencontainers.image.source=https://github.com/{{ .Env.ORG }}/{{ .Env.REPO }}"
- "--label=org.opencontainers.image.description=Topaz Authorizer"
- "--label=org.opencontainers.image.licenses=Apache-2.0"

- use: buildx
goos: linux
goarch: arm64
Expand Down
6 changes: 3 additions & 3 deletions Depfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ go:
version: "v0.5.0"
goreleaser:
importPath: github.com/goreleaser/goreleaser
version: "v1.18.2"
version: "v1.20.0"
gotestsum:
importPath: "gotest.tools/gotestsum"
version: "v1.10.0"
version: "v1.10.1"
golangci-lint:
importPath: "github.com/golangci/golangci-lint/cmd/golangci-lint"
version: "v1.52.2"
version: "v1.54.2"
goimports:
importPath: "golang.org/x/tools/cmd/goimports"
version: "latest"
Expand Down

0 comments on commit 7af8342

Please sign in to comment.