Skip to content

Commit 4c78d5a

Browse files
committed
Move and renamed publish-npm workflow
1 parent 92db364 commit 4c78d5a

File tree

2 files changed

+66
-8
lines changed

2 files changed

+66
-8
lines changed

.github/workflows/publish-npm.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: 'Release'
2+
description: 'Releases a package'
3+
inputs:
4+
scope:
5+
description: 'The package to release. Must match a package specified in lerna.json.'
6+
version:
7+
description: 'The type of version to release.'
8+
tag:
9+
description: 'The tag to publish to on NPM.'
10+
preid:
11+
description: "Prerelease identifier such as 'alpha', 'beta', 'rc', or 'next'. Leave blank to skip prerelease tagging."
12+
working-directory:
13+
description: 'The directory of the package.'
14+
folder:
15+
default: './'
16+
description: 'A folder containing a package.json file.'
17+
node-version:
18+
description: 'Node.js version to use when publishing.'
19+
required: false
20+
default: '24.x'
21+
runs:
22+
using: 'composite'
23+
steps:
24+
- name: 🟢 Configure Node for Publish
25+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
26+
with:
27+
node-version: ${{ inputs.node-version }}
28+
registry-url: 'https://registry.npmjs.org'
29+
# Provenance requires npm 9.5.0+
30+
- name: 📦 Install latest npm
31+
run: npm install -g npm@latest
32+
shell: bash
33+
# This ensures the local version of Lerna is installed
34+
# and that we do not use the global Lerna version
35+
- name: 🕸️ Install root dependencies
36+
run: npm ci
37+
shell: bash
38+
- name: 📦 Install Dependencies
39+
run: npx lerna@5 bootstrap --include-dependencies --scope ${{ inputs.scope }} --ignore-scripts -- --legacy-peer-deps
40+
shell: bash
41+
working-directory: ${{ inputs.working-directory }}
42+
- name: 🏷️ Set Version
43+
run: |
44+
if [ -z "${{ inputs.preid }}" ]; then
45+
npx lerna@5 version ${{ inputs.version }} --yes --exact --no-changelog --no-push --no-git-tag-version
46+
else
47+
npx lerna@5 version ${{ inputs.version }} --yes --exact --no-changelog --no-push --no-git-tag-version --preid=${{ inputs.preid }}
48+
fi
49+
shell: bash
50+
working-directory: ${{ inputs.working-directory }}
51+
- name: 🏗️ Run Build
52+
run: npm run build
53+
shell: bash
54+
working-directory: ${{ inputs.working-directory }}
55+
- name: 🚀 Publish to NPM
56+
run: npm publish ${{ inputs.folder }} --tag ${{ inputs.tag }} --provenance
57+
shell: bash
58+
working-directory: ${{ inputs.working-directory }}

.github/workflows/release-ionic.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
27-
- uses: ./.github/workflows/actions/publish-npm
27+
- uses: ./.github/workflows/publish-npm.yml
2828
with:
2929
scope: '@ionic/core'
3030
tag: ${{ inputs.tag }}
@@ -55,7 +55,7 @@ jobs:
5555
name: ionic-docs
5656
path: ./packages/docs
5757
filename: DocsBuild.zip
58-
- uses: ./.github/workflows/actions/publish-npm
58+
- uses: ./.github/workflows/publish-npm.yml
5959
with:
6060
scope: '@ionic/docs'
6161
tag: ${{ inputs.tag }}
@@ -74,7 +74,7 @@ jobs:
7474
name: ionic-core
7575
path: ./core
7676
filename: CoreBuild.zip
77-
- uses: ./.github/workflows/actions/publish-npm
77+
- uses: ./.github/workflows/publish-npm.yml
7878
with:
7979
scope: '@ionic/angular'
8080
tag: ${{ inputs.tag }}
@@ -100,7 +100,7 @@ jobs:
100100
name: ionic-core
101101
path: ./core
102102
filename: CoreBuild.zip
103-
- uses: ./.github/workflows/actions/publish-npm
103+
- uses: ./.github/workflows/publish-npm.yml
104104
with:
105105
scope: '@ionic/react'
106106
tag: ${{ inputs.tag }}
@@ -125,7 +125,7 @@ jobs:
125125
name: ionic-core
126126
path: ./core
127127
filename: CoreBuild.zip
128-
- uses: ./.github/workflows/actions/publish-npm
128+
- uses: ./.github/workflows/publish-npm.yml
129129
with:
130130
scope: '@ionic/vue'
131131
tag: ${{ inputs.tag }}
@@ -150,7 +150,7 @@ jobs:
150150
name: ionic-core
151151
path: ./core
152152
filename: CoreBuild.zip
153-
- uses: ./.github/workflows/actions/publish-npm
153+
- uses: ./.github/workflows/publish-npm.yml
154154
with:
155155
scope: '@ionic/angular-server'
156156
tag: ${{ inputs.tag }}
@@ -176,7 +176,7 @@ jobs:
176176
name: ionic-react
177177
path: ./packages/react
178178
filename: ReactBuild.zip
179-
- uses: ./.github/workflows/actions/publish-npm
179+
- uses: ./.github/workflows/publish-npm.yml
180180
with:
181181
scope: '@ionic/react-router'
182182
tag: ${{ inputs.tag }}
@@ -201,7 +201,7 @@ jobs:
201201
name: ionic-vue
202202
path: ./packages/vue
203203
filename: VueBuild.zip
204-
- uses: ./.github/workflows/actions/publish-npm
204+
- uses: ./.github/workflows/publish-npm.yml
205205
with:
206206
scope: '@ionic/vue-router'
207207
tag: ${{ inputs.tag }}

0 commit comments

Comments
 (0)