Skip to content

Commit

Permalink
feat(all): 🎸 增加 js-plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Maidang1 committed Sep 25, 2024
1 parent 486aa98 commit 3470ecb
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 32 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ jobs:
build:
name: Build and Upload Artifacts - ${{ matrix.settings.abi }}
runs-on: ${{ matrix.settings.os }}
if: github.event_name == 'pull_request' && (contains(github.event.pull_request.title, 'rust-plugins') || contains(github.event.pull_request.title, 'all'))
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -66,7 +65,7 @@ jobs:
with:
fetch-depth: 2
- run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/main
git fetch --no-tags --prune --depth=1 origin +refs/heads/main:refs/remotes/origin/main
- name: Cache rust artifacts
uses: Swatinem/rust-cache@v2
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:

jobs:
call-rust-build:
if: github.event_name == 'pull_request' && (contains(github.event.pull_request.title, 'rust-plugins') || contains(github.event.pull_request.title, 'all'))
uses: ./.github/workflows/build.yaml
call-js-build:
uses: ./.github/workflows/js-plugin-build.yaml
if: github.event_name == 'pull_request' && (contains(github.event.pull_request.title, 'js-plugins') || contains(github.event.pull_request.title, 'all'))
uses: ./.github/workflows/js-plugin-build.yaml
3 changes: 1 addition & 2 deletions .github/workflows/js-plugin-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ on: workflow_call

jobs:
build:
if: github.event_name == 'pull_request' && (contains(github.event.pull_request.title, 'js-plugins') || contains(github.event.pull_request.title, 'all'))
runs-on: ubuntu-latest
name: release
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/main
git fetch --no-tags --prune --depth=1 origin +refs/heads/main:refs/remotes/origin/main
- name: Setup Node
uses: actions/setup-node@v3
with:
Expand Down
28 changes: 4 additions & 24 deletions .github/workflows/release-js-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,17 @@ on:
- main

jobs:
publish:
if: github.event_name == 'pull_request' && (contains(github.event.pull_request.title, 'js-plugins') || contains(github.event.pull_request.title, 'all'))

release:
runs-on: ubuntu-latest

name: release

steps:
- name: Checkout Commit
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 2
token: ${{ secrets.GH_TOKEN }}

- run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/main
- name: Update Master
run: |
git pull --force --no-tags origin main:main
git checkout main
git fetch --tags
git fetch --no-tags --prune --depth=1 origin +refs/heads/main:refs/remotes/origin/main
- name: Setup Node
uses: actions/setup-node@v3
Expand All @@ -40,14 +29,6 @@ jobs:
run: |
corepack enable
- name: pnpm Cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-setup.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Initliaze .npmrc
run: >
echo -e "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}\n$(cat .npmrc)" > .npmrc
Expand All @@ -62,5 +43,4 @@ jobs:
- name: Release and Publish Packages
run: |
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} && npm config set access public && pnpm --filter "{js-plugins}[origin/main]" publish --no-git-checks
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} && npm config set access public && pnpm --filter "{js-plugins}[origin/main]" publish --no-git-checks
4 changes: 1 addition & 3 deletions .github/workflows/release-rust-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
call-rust-build:
if: github.event_name == 'pull_request' && (contains(github.event.pull_request.title, 'rust-plugins') || contains(github.event.pull_request.title, 'all'))
uses: ./.github/workflows/build.yaml

release:
if: github.event_name == 'pull_request' && (contains(github.event.pull_request.title, 'rust-plugins') || contains(github.event.pull_request.title, 'all'))
name: Release
needs: [call-rust-build]
runs-on: ubuntu-latest
Expand All @@ -22,7 +20,7 @@ jobs:
with:
fetch-depth: 2
- run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/main
git fetch --no-tags --prune --depth=1 origin +refs/heads/main:refs/remotes/origin/main
- name: Setup Node.js 18.x
uses: actions/setup-node@v3
Expand Down

0 comments on commit 3470ecb

Please sign in to comment.