From dfab28e352dea7ace5c004d585c9bf6dddc20c2b Mon Sep 17 00:00:00 2001 From: kunish Date: Sun, 27 Aug 2023 23:38:13 +0800 Subject: [PATCH] ci: add release please --- .github/workflows/release.yml | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f18dccf --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +on: + push: + branches: main + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + outputs: + release_created: ${{ steps.release.outputs.release_created }} + tag_name: ${{ steps.release.outputs.tag_name }} + + steps: + - name: release-please + id: release + uses: google-github-actions/release-please-action@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + release-type: node + + release: + needs: release-please + runs-on: ubuntu-latest + if: ${{ needs.release-please.outputs.release_created }} + steps: + - uses: actions/checkout@v3 + + - uses: pnpm/action-setup@v2 + with: + version: latest + + - uses: actions/setup-node@v3 + with: + cache: pnpm + node-version: latest + + - name: build + run: | + pnpm install + pnpm build + + - name: attach release artifacts + uses: softprops/action-gh-release@v1 + with: + files: dist/ + tag_name: ${{ needs.release-please.outputs.tag_name }}