ci: deduplicate publish workflow
This commit is contained in:
parent
14641d170d
commit
67bc1e37c3
1 changed files with 6 additions and 30 deletions
36
.github/workflows/publish.yml
vendored
36
.github/workflows/publish.yml
vendored
|
|
@ -30,37 +30,13 @@ jobs:
|
|||
with:
|
||||
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
|
||||
npm_cli:
|
||||
name: Publish CLI to npmjs.com
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get latest tag
|
||||
id: latest_tag
|
||||
run: |
|
||||
echo "tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Check out latest tag
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ steps.latest_tag.outputs.tag }}
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- name: Publish CLI to npmjs.com
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
||||
run: |
|
||||
cd cli/npm
|
||||
npm publish
|
||||
|
||||
|
||||
npm_lib:
|
||||
npm:
|
||||
name: Publish lib to npmjs.com
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
directory: ["cli/npm", "lib/binding_web"]
|
||||
steps:
|
||||
- name: Get latest tag
|
||||
id: latest_tag
|
||||
|
|
@ -82,5 +58,5 @@ jobs:
|
|||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
||||
run: |
|
||||
cd lib/binding_web
|
||||
cd ${{ matrix.directory }}
|
||||
npm publish
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue