mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-04-13 00:00:10 +08:00
Split publish into a separate reusable workflow (publish.yml) that can be triggered manually via workflow_dispatch or called from release- please. This allows re-running publish independently when a release already exists but publishing failed.
40 lines
715 B
YAML
40 lines
715 B
YAML
name: Publish to npm
|
|
|
|
on:
|
|
workflow_call:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4.3.1
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4.4.0
|
|
with:
|
|
node-version: 22
|
|
cache: npm
|
|
registry-url: https://registry.npmjs.org
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Lint
|
|
run: npm run lint -- --quiet
|
|
|
|
- name: Test
|
|
run: npm test
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Publish to npm
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
run: npm run npmpub
|