From ec9b27e131bc65d9c57f8713a7ad2d7b1e98e220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20N=C3=A4gele?= Date: Tue, 1 Sep 2020 21:50:53 +0200 Subject: [PATCH 1/3] Fix release workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Install required tooling * Create Git tag locally instead of via GitHub API so Goreleaser can find it Signed-off-by: Reinhard Nägele --- .github/workflows/ci.yaml | 9 ++++----- .github/workflows/release.yaml | 33 +++++++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ea25d62e..edefe02a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,11 +14,12 @@ 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') }} @@ -26,9 +27,7 @@ jobs: ${{ 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 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a274ea2e..fc2a54e1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -16,11 +16,36 @@ jobs: with: fetch-depth: 0 - - name: Tag - uses: tvdias/github-tagger@v0.0.2 + - 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: Tag + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + tag='${{ github.event.inputs.version }}' + git tag --annotate --message "Tag for release $tag" "$tag" + git push "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY" "refs/tags/$tag" + + - name: Check License Headers + run: mage -v checkLicenseHeaders + + - name: Lint + run: mage -v lint - name: Test run: mage -v test From 91bfa7d62bc146a92206378285b493b8d1b767f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20N=C3=A4gele?= Date: Tue, 1 Sep 2020 22:15:51 +0200 Subject: [PATCH 2/3] Do linting before tagging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Reinhard Nägele --- .github/workflows/release.yaml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index fc2a54e1..099e2e38 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -32,14 +32,6 @@ jobs: - name: Install tools run: ./setup.sh - - name: Tag - run: | - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - - tag='${{ github.event.inputs.version }}' - git tag --annotate --message "Tag for release $tag" "$tag" - git push "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY" "refs/tags/$tag" - name: Check License Headers run: mage -v checkLicenseHeaders @@ -50,6 +42,15 @@ jobs: - name: Test run: mage -v test + - name: Tag + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + 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: From d11ca415a09cb392321d1e72bc822573c206dd8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20N=C3=A4gele?= Date: Wed, 2 Sep 2020 08:37:43 +0200 Subject: [PATCH 3/3] Remove empty line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Reinhard Nägele --- .github/workflows/release.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 099e2e38..1e66b0af 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -32,7 +32,6 @@ jobs: - name: Install tools run: ./setup.sh - - name: Check License Headers run: mage -v checkLicenseHeaders