feat: 去除包的private #63
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- main | |
permissions: write-all | |
jobs: | |
check-files: | |
runs-on: ubuntu-latest | |
name: Check files changed | |
outputs: | |
changed-files: ${{ toJSON(steps.changed-files-specific.outputs) }} | |
bump-version: ${{ steps.changed-files-specific.outputs.only_changed == 'false' }} | |
steps: | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get changed files in the docs folder | |
id: changed-files-specific | |
uses: tj-actions/changed-files@v42 | |
with: | |
files: | | |
src/** | |
files_ignore: | | |
!packages/**/* | |
release: | |
if: needs.check-files.outputs.bump-version == 'true' | |
runs-on: ubuntu-latest | |
needs: | |
- check-files | |
steps: | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: ^8 | |
run_install: false | |
- name: Set node version | |
uses: actions/setup-node@v4 | |
with: | |
registry-url: https://registry.npmjs.org/ | |
node-version: 20 | |
cache: "pnpm" | |
- name: Install deps | |
run: pnpm install --no-frozen-lockfile | |
- name: Build | |
run: pnpm run build | |
- name: Publish package | |
run: | | |
npm config set '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_TOKEN }}" | |
# pnpm -r --filter "./packages/*" --filter "./packages/**/*" exec npm publish --access public --no-git-checks | |
pnpm run publish-pkg | |
# changelog: | |
# if: needs.check-files.outputs.bump-version == 'true' | |
# runs-on: ubuntu-latest | |
# needs: | |
# - check-files | |
# steps: | |
# - name: get-npm-version | |
# id: package-version | |
# uses: martinbeentjes/npm-get-version-action@main | |
# - name: Checkout | |
# uses: actions/checkout@v3 | |
# with: | |
# fetch-depth: 0 | |
# - name: Install pnpm | |
# uses: pnpm/action-setup@v2 | |
# with: | |
# version: ^7 | |
# - name: Set node version | |
# uses: actions/setup-node@v3 | |
# with: | |
# registry-url: https://registry.npmjs.org/ | |
# node-version: "18" | |
# cache: "pnpm" | |
# - name: Install deps | |
# run: pnpm install | |
# - name: Set Git config | |
# run: | | |
# git config --global user.email "[email protected]" | |
# git config --global user.name "Rain120" | |
# - name: Generate changelog | |
# id: changelog | |
# run: | | |
# pnpm run changelog | |
# git add . | |
# git commit -am "chore(release): update changelog" | |
# - name: Push changeslog | |
# uses: ad-m/github-push-action@master | |
# with: | |
# github_token: ${{ secrets.ACCESS_TOKEN }} | |
# branch: ${{ github.ref }} |