From 93caeada0f7eb5f6dda30137d07306dbcd636be8 Mon Sep 17 00:00:00 2001 From: Takeshi Yamashita <220619+takecy@users.noreply.github.com> Date: Thu, 26 Oct 2023 01:50:32 +0900 Subject: [PATCH 1/2] chore: add workflow for tagging and create release --- .github/workflows/tagging.yml | 14 ------- .github/workflows/tagging_release.yml | 53 +++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 14 deletions(-) delete mode 100644 .github/workflows/tagging.yml create mode 100644 .github/workflows/tagging_release.yml diff --git a/.github/workflows/tagging.yml b/.github/workflows/tagging.yml deleted file mode 100644 index ea195dc..0000000 --- a/.github/workflows/tagging.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Bump version -on: - workflow_dispatch: -jobs: - tagging: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Bump version and push tag - uses: mathieudutour/github-tag-action@v5.5 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - release_branches: master - tag_prefix: "v" \ No newline at end of file diff --git a/.github/workflows/tagging_release.yml b/.github/workflows/tagging_release.yml new file mode 100644 index 0000000..ebf77fa --- /dev/null +++ b/.github/workflows/tagging_release.yml @@ -0,0 +1,53 @@ +name: Bump version and Create release. + +on: + workflow_dispatch: + +jobs: + tagging-release: + runs-on: ubuntu-latest + timeout-minutes: 2 + steps: + - uses: actions/checkout@v4 + + - name: Bump version and push tag + id: tag_version + uses: mathieudutour/github-tag-action@v6.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + release_branches: master + tag_prefix: "v" + + - name: Get latest release + uses: actions/github-script@v6 + id: latest_release + with: + result-encoding: string + retries: 3 + script: | + const res = await github.rest.repos.getLatestRelease({ + owner: context.repo.owner, + repo: context.repo.repo, + }) + return res.data.tag_name; + + - name: Generate release note and Create release + uses: actions/github-script@v6 + with: + retries: 3 + script: | + const note = await github.rest.repos.generateReleaseNotes({ + owner: context.repo.owner, + repo: context.repo.repo, + tag_name: "${{ steps.tag_version.outputs.new_tag }}", + previous_tag_name: "${{ steps.latest_release.outputs.result }}" + }) + + const res = await github.rest.repos.createRelease({ + owner: context.repo.owner, + repo: context.repo.repo, + tag_name: "${{ steps.tag_version.outputs.new_tag }}", + name: note.data.name, + body: note.data.body + }) + return res.data; \ No newline at end of file From 01c776f979d5317aaa6aafcc980f68d275fcd878 Mon Sep 17 00:00:00 2001 From: Takeshi Yamashita <220619+takecy@users.noreply.github.com> Date: Thu, 26 Oct 2023 01:52:21 +0900 Subject: [PATCH 2/2] chore: add go version in unit test 1.21 --- .github/workflows/unit_test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml index 9635184..684f3bc 100644 --- a/.github/workflows/unit_test.yml +++ b/.github/workflows/unit_test.yml @@ -11,12 +11,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: [ '1.18', '1.19', '1.20' ] + go: [ '1.18', '1.19', '1.20', '1.21' ] name: Go ${{ matrix.go }} test steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: ${{ matrix.go }} - name: test