Skip to content

implement multi-account support and finish service-account logic in c… #16

implement multi-account support and finish service-account logic in c…

implement multi-account support and finish service-account logic in c… #16

Workflow file for this run

name: main
on:
pull_request:
types:
- opened
- synchronize
- reopened
# TODO: break this up into separate workflows for a more idiomatic GHA setup. anything that is doing "if branch" is a candidate
jobs:
test:
runs-on: ubuntu-latest
if: github.event_name == 'push' && !contains(toJson(github.event.commits), '[ci skip]') && !contains(toJson(github.event.commits), '[skip ci]')
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: go.mod
cache: true
- name: install golangci-lint
run: |
mkdir -p "$HOME/bin"
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b "$HOME/bin"
echo "$HOME/bin" >> $GITHUB_PATH
shell: bash # force windows to use git-bash for access to curl
- name: install goreleaser
# only need to lint goreleaser on one platform:
if: startsWith(runner.os, 'Linux')
run: curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sudo sh -s -- -b /usr/local/bin
- run: make lint
shell: bash
- run: make test
shell: bash
release-test:
needs: [test]
# don't waste time running a goreleaser test build on master since we will run a full release:
if: github.ref != 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: go.mod
cache: true
- name: install goreleaser
run: curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sudo sh -s -- -b /usr/local/bin
- run: make snapshot
release:
needs: [test]
# only create a release on master builds:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: go.mod
cache: true
- name: install goreleaser
run: curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sudo sh -s -- -b /usr/local/bin
- name: run autotag to increment version
run: |
curl -sL https://git.io/autotag-install | sudo sh -s -- -b /usr/local/bin
autotag
- name: build and push release artifacts
env:
GITHUB_TOKEN: ${{ secrets.BREW_GITHUB_TOKEN }}
run: |
make deps
make release