diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 2699bfc..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: build - -on: - push: - branches: - - master - pull_request: - branches: - - '*' - -jobs: - ci-build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: git fetch --prune --unshallow - - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - - uses: actions/setup-go@v2 - with: - go-version: 1.15 diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index d31e87f..0000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Go - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - - build: - name: Build - runs-on: ubuntu-latest - steps: - - - name: Set up Go 1.x - uses: actions/setup-go@v2 - with: - go-version: ^1.13 - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Get dependencies - run: | - go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure - fi - - - name: Build - run: go build -v . - - - name: Test - run: go test -v . diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 81b5e1a..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: publish - -on: - push: - tags: - - '*' - -jobs: - goreleaser: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: git fetch --prune --unshallow - - uses: actions/setup-go@v2 - with: - go-version: 1.14 - - run: docker login docker.pkg.github.com -u docker -p ${{ secrets.GITHUB_TOKEN }} - - uses: goreleaser/goreleaser-action@v2 - with: - version: v0.142.0 - args: release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0d30bf5..8b99b51 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,36 @@ name: release + on: push: branches: - master + pull_request: + branches: + - '*' jobs: + ci-build: + strategy: + matrix: + go-version: [ 1.14.x, 1.15.x ] + os: [ ubuntu-latest, ubuntu-20.04, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - run: git fetch --prune --unshallow + - uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + - name: Install Go ${{ matrix.go-version }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: Go version + run: go version + - name: Test + run: go test ./... + - name: Build + run: go build release: name: Release runs-on: ubuntu-latest @@ -20,9 +47,10 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: semantic-release $DRY_RUN_OPT - - uses: actions/setup-go@v2 + - name: Set up Go 1.x + uses: actions/setup-go@v2 with: - go-version: 1.15 + go-version: ^1.14 - run: docker login docker.pkg.github.com -u docker -p ${{ secrets.GITHUB_TOKEN }} - uses: goreleaser/goreleaser-action@v2 with: