Skip to content

Commit

Permalink
ci(yml): 自动release
Browse files Browse the repository at this point in the history
  • Loading branch information
aliothor committed Oct 16, 2023
1 parent 0c3129f commit 1c97b04
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 38 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/auto-merge.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Package to npmjs
name: Publish Package To Npm

permissions:
contents: read
Expand Down
35 changes: 28 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@
name: release-please

on:
push:
branches:
- master

name: Release
- main

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v3
- uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.RELEASE_TOKEN }}
release-type: node
package-name: standard-version
changelog-types: '[{"type": "types", "section":"Types", "hidden": false},{"type": "revert", "section":"Reverts", "hidden": false},{"type": "feat", "section": "Features", "hidden": false},{"type": "fix", "section": "Bug Fixes", "hidden": false},{"type": "improvement", "section": "Feature Improvements", "hidden": false},{"type": "docs", "section":"Docs", "hidden": false},{"type": "style", "section":"Styling", "hidden": false},{"type": "refactor", "section":"Code Refactoring", "hidden": false},{"type": "perf", "section":"Performance Improvements", "hidden": false},{"type": "test", "section":"Tests", "hidden": false},{"type": "build", "section":"Build System", "hidden": false},{"type": "ci", "section":"CI", "hidden":false}]'
package-name: release-please-action
# Checkout
- uses: actions/checkout@v3
if: ${{ steps.release.outputs.release_created }}
# Setup node
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}
# Setup pnpm
- uses: pnpm/action-setup@v2
if: ${{ steps.release.outputs.release_created }}
# Install dependencies
- run: pnpm install
if: ${{ steps.release.outputs.release_created }}
# Build output
- run: pnpm build
if: ${{ steps.release.outputs.release_created }}
# Publish to npm
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}

0 comments on commit 1c97b04

Please sign in to comment.