Skip to content

Commit

Permalink
Fix release workflow (#78)
Browse files Browse the repository at this point in the history
* Install required tooling
* Create Git tag locally instead of via GitHub API so Goreleaser
  can find it

Signed-off-by: Reinhard Nägele <[email protected]>
  • Loading branch information
unguiculus authored Sep 2, 2020
1 parent 5dc9325 commit 4f86929
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 9 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,20 @@ jobs:
uses: actions/checkout@v2

- name: Setup Go
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: "1.14.5"

- uses: actions/cache@v1
- name: Cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install tools
run: |
./setup.sh
echo "::add-path::$(go env GOPATH)/bin"
run: ./setup.sh

- name: Check License Headers
run: mage -v checkLicenseHeaders
Expand Down
33 changes: 29 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,40 @@ jobs:
with:
fetch-depth: 0

- name: Tag
uses: tvdias/[email protected]
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "1.14.5"

- name: Cache
uses: actions/cache@v2
with:
repo-token: "${{ secrets.CI_TOKEN }}"
tag: "${{ github.event.inputs.version }}"
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install tools
run: ./setup.sh

- name: Check License Headers
run: mage -v checkLicenseHeaders

- name: Lint
run: mage -v lint

- name: Test
run: mage -v test

- name: Tag
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
tag='${{ github.event.inputs.version }}'
git tag --annotate --message "Tag for release $tag" "$tag"
git push origin "refs/tags/$tag"
- name: Release
run: mage -v release
env:
Expand Down

0 comments on commit 4f86929

Please sign in to comment.