diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..583f07c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +on: + push: + tags: + - "v*" +permissions: + contents: write +jobs: + changelog: + runs-on: + - ubuntu-latest + steps: + - name: "✏️ 生成变更日志" + uses: heinrichreimer/action-github-changelog-generator@v2.3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + unit-test: + runs-on: + - ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: 'stable' + - run: go mod tidy + - run: go mod vendor + - run: go test -v ./... + name: "🐞 单元测试" + continue-on-error: true + release: + runs-on: + - ubuntu-latest + needs: + - changelog + steps: + - name: "🚄 发布 release" + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/v') + with: + body: ${{needs.changelog.output.changelog}} + fail_on_unmatched_files: false \ No newline at end of file