Skip to content

Commit

Permalink
ci: add release workflow
Browse files Browse the repository at this point in the history
release-as: 0.1.0-rc.1
  • Loading branch information
MuXiu1997 committed Nov 25, 2023
1 parent d3fc50a commit dc91d50
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Release

on:
push:
branches:
- main


env:
NODE_VERSION: '20'
PNPM_VERSION: '8'

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Release
id: release
uses: google-github-actions/release-please-action@v3
with:
release-type: node

- name: Checkout
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v3
with:
ref: ${{ steps.release.outputs.tag_name }}

- name: Setup Pnpm
if: ${{ steps.release.outputs.release_created }}
uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}

- name: Setup Node
if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'

- name: Install Node Dependencies
if: ${{ steps.release.outputs.release_created }}
run: pnpm install

- name: Bundle
if: ${{ steps.release.outputs.release_created }}
run: pnpm run bundle

- name: Publish
if: ${{ steps.release.outputs.release_created }}
run: pnpm publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit dc91d50

Please sign in to comment.