From 11db2c2e120ad44fabc195c3ff3152b7db233ab1 Mon Sep 17 00:00:00 2001 From: wregulski Date: Mon, 28 Aug 2023 15:34:37 +0200 Subject: [PATCH 1/2] fix: syndicate and bump-version changes --- .github/workflows/bump-version.yml | 33 +++++++++++++++++++----------- .github/workflows/release.yml | 5 ++--- Taskfile.yml | 5 +---- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index bdb5cbe..bfcc240 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -1,33 +1,42 @@ name: bump-version + on: push: branches: - main + permissions: - contents: write - pull-requests: write + contents: write + pull-requests: write + jobs: release: runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v3 - name: release-please id: release uses: GoogleCloudPlatform/release-please-action@v3 with: token: ${{ secrets.TOKEN }} release-type: go - - - name: merge-pr + - name: Get created PR number + id: pr-number if: steps.release.outputs.pr uses: actions/github-script@v6 with: - github-token: ${{ secrets.TOKEN }} + result-encoding: string script: | const pr = ${{ steps.release.outputs.pr }}; - if (pr && pr.number) { - github.rest.pulls.merge({ - pull_number: pr.number, - owner: context.repo.owner, - repo: context.repo.repo - }); - } + return pr && pr.number + - name: Approve Release PR + if: steps.release.outputs.pr + run: gh pr review ${{ steps.pr-number.outputs.result }} --approve + env: + GH_TOKEN: ${{ github.token }} + - name: Merge Release PR + if: steps.release.outputs.pr + run: gh pr merge ${{ steps.pr-number.outputs.result }} --auto --rebase + env: + GH_TOKEN: ${{ secrets.TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b429e8..a44c617 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,18 +10,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install Task run: | curl -sL https://taskfile.dev/install.sh | sh sudo mv ./bin/task /usr/local/bin - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: 1.21 - name: Sync with GoDocs using Taskfile run: task godocs env: - GIT_DOMAIN: ${{ github.server_url }} REPO: ${{ github.repository }} VERSION_SHORT: ${{ github.ref }} diff --git a/Taskfile.yml b/Taskfile.yml index 735f669..9b70b8d 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -15,7 +15,4 @@ tasks: desc: Sync the latest tag with GoDocs cmds: - echo "syndicating to GoDocs..." - - test $(GIT_DOMAIN) - - test $(REPO) - - test $(VERSION_SHORT) - - curl https://proxy.golang.org/$(GIT_DOMAIN)/$(REPO)/@v/$(VERSION_SHORT).info + - curl "https://proxy.golang.org/github.com/$REPO/v/$VERSION_SHORT.info" From fd85107b44e0754131588a9b1f6e6ba7ea075b4d Mon Sep 17 00:00:00 2001 From: wregulski Date: Wed, 30 Aug 2023 12:18:35 +0200 Subject: [PATCH 2/2] feat: moves godocs syndicate right to the github actions --- .github/workflows/release.yml | 19 +++++-------------- Taskfile.yml | 6 ------ 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a44c617..2a71881 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,18 +9,9 @@ jobs: syndicate: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 - - name: Install Task + - name: Install cURL + run: sudo apt-get install curl -y + - name: Syndicate to GoDocs run: | - curl -sL https://taskfile.dev/install.sh | sh - sudo mv ./bin/task /usr/local/bin - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: 1.21 - - name: Sync with GoDocs using Taskfile - run: task godocs - env: - REPO: ${{ github.repository }} - VERSION_SHORT: ${{ github.ref }} + echo "syndicating to GoDocs..." + curl "https://proxy.golang.org/github.com/${{ github.repository }}/v/${{ github.ref }}/info" diff --git a/Taskfile.yml b/Taskfile.yml index 9b70b8d..96eb9bb 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -10,9 +10,3 @@ tasks: desc: Run lint cmds: - golangci-lint run - - godocs: - desc: Sync the latest tag with GoDocs - cmds: - - echo "syndicating to GoDocs..." - - curl "https://proxy.golang.org/github.com/$REPO/v/$VERSION_SHORT.info"