-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
82 lines (65 loc) · 2.43 KB
/
npm_release_tns_core.yml
File metadata and controls
82 lines (65 loc) · 2.43 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
78
79
80
81
82
name: 'tns-core-modules -> npm'
permissions:
contents: read
pull-requests: write
on:
push:
branches: [ 'tns-core-modules' ]
paths:
- 'nativescript-core/**'
workflow_dispatch:
env:
NPM_TAG: 'tns-next'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
with:
egress-policy: audit
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Setup
run: npm install
- name: Generate Version
run: |
echo NPM_VERSION=$(node -e "console.log(require('./package.json').version);")-$NPM_TAG-$(date +"%m-%d-%Y")-$GITHUB_RUN_ID >> $GITHUB_ENV
- name: Bump Versions
run: |
# bump root version
npm version --no-git-tag-version $NPM_VERSION
# bump @nativescript/core
cd nativescript-core
npm version --no-git-tag-version $NPM_VERSION
cd ..
# bump tns-core-modules version & @nativescript/core dep
cd tns-core-modules-package
npm version --no-git-tag-version $NPM_VERSION
cat <<EOT > _bump_core.js
const {readFileSync: read, writeFileSync: write} = require('fs'),
p = 'package.json',
pkg = read(p).toString()
ver = process.argv.splice(2).join(' ');
u = pkg.replace(/("@nativescript\/core": ")(?:.+)(")/g, \`\$1\${ver}\$2\`);
console.log(u)
write(p, u);
EOT
node _bump_core.js $NPM_VERSION
# for debugging - just show diff
git diff package.json
cd ..
- name: Build @nativescript/core
run: npm run build-core
- name: Build tns-core-modules
run: npm run build-compat
- name: Publish @nativescript/core
working-directory: dist
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ../.npmrc
ls -al
echo "Publishing @nativescript/core@$NPM_VERSION to NPM with tag $NPM_TAG..."
# npm publish nativescript-core-$NPM_VERSION.tgz --tag $NPM_TAG --dry-run
echo "Publishing tns-core-modules@$NPM_VERSION to NPM with tag $NPM_TAG..."
# npm publish tns-core-modules-$NPM_VERSION.tgz --tag $NPM_TAG --dry-run