Skip to content

Commit

Permalink
Update GitHub Actions workflows (#40)
Browse files Browse the repository at this point in the history
Slide test versions window.
Check tags before releasing.
Add concurrency checks.
  • Loading branch information
jlucktay authored Nov 7, 2021
1 parent 6cedcdc commit 5d470f8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,24 @@ on:
permissions:
contents: read

# Concurrency ensures that only a single workflow using the same concurrency group will run at a time.
# When a workflow is queued in the same repository and concurrency group, any workflow in progress will be cancelled.
# This concurrency group is keyed to the 'ref' property in the 'github' context, to map back to the branch/tag that
# triggered this workflow run.
concurrency:
cancel-in-progress: true
group: make_all_${{ github.ref }}

jobs:
build:
name: Test and lint and build

strategy:
matrix:
go-version:
- 1.14.x
- 1.15.x
- 1.16.x
- 1.17.x
platform:
- ubuntu-latest
- macos-latest
Expand Down
28 changes: 27 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,40 @@ on:
permissions:
contents: write

# Concurrency ensures that only a single workflow using the same concurrency group will run at a time.
# When a workflow is queued in the same repository and concurrency group, any workflow in progress will be cancelled.
# This concurrency group is keyed to the 'ref' property in the 'github' context, to map back to the branch/tag that
# triggered this workflow run.
concurrency:
cancel-in-progress: true
group: release_${{ github.ref }}

jobs:
check-tag:
runs-on: ubuntu-latest

steps:
- name: Check out ${{ github.repository }} - all history
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Confirm that the 'main' branch contains the '${{ github.ref }}' tag
run: >
git branch --all --contains '${{ github.ref }}' --no-column --format='%(refname)'
| grep -c '\/main$'
goreleaser:
runs-on: ubuntu-latest

needs:
- check-tag

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
fetch-depth: 1

- name: Set up Go
uses: actions/setup-go@v2
Expand Down

0 comments on commit 5d470f8

Please sign in to comment.