forked from NativeScript/nativescript-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (61 loc) · 2.17 KB
/
npm_release_cli.yml
File metadata and controls
77 lines (61 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: 'nativescript -> npm'
on:
workflow_dispatch:
inputs:
bump_version:
description: 'Bump Version'
required: true
default: true
type: boolean
next_version:
description: 'Next Version with Next tag'
required: true
default: false
type: boolean
permissions:
contents: read
jobs:
release:
runs-on: macos-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: 22.14.0
- name: Setup
run: npm i --ignore-scripts --legacy-peer-deps --no-package-lock
- name: Bump Standard Version
if: github.event.inputs.bump_version == 'true'
run: |
npm run release
- name: Generate Version
run: |
echo NPM_VERSION=$(node -e "console.log(require('./package.json').version);") >> $GITHUB_ENV
- name: Bump Version
if: github.event.inputs.next_version == 'true'
run: npm version $NPM_VERSION
- name: Build nativescript
run: npm pack
- name: npm ENV
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
- name: Publish next nativescript version
if: github.event.inputs.next_version == 'true'
run: |
echo "Publishing nativescript@$NPM_VERSION to NPM with tag $NPM_TAG..."
npm publish akylas-nativescript-cli-$NPM_VERSION.tgz --tag $NPM_TAG
- name: Publish nativescript
if: github.event.inputs.next_version == 'false'
run: |
echo "Publishing nativescript@$NPM_VERSION to NPM..."
npm publish akylas-nativescript-cli-$NPM_VERSION.tgz
- name: Push to git
if: github.event.inputs.bump_version == 'true'
run: |
git push origin --tags
git push origin