Skip to content

Commit

Permalink
Merge pull request #246 from awa/act
Browse files Browse the repository at this point in the history
chore: add workflow for tagging and create release
  • Loading branch information
takecy authored Oct 25, 2023
2 parents de73450 + 01c776f commit 2e80aef
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 17 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/tagging.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/tagging_release.yml
Original file line number Diff line number Diff line change
@@ -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;
6 changes: 3 additions & 3 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2e80aef

Please sign in to comment.