@@ -4,89 +4,54 @@ permissions:
44 pull-requests : write
55
66on :
7+ push :
8+ branches : [ 'main' ]
9+ paths :
10+ - ' packages/core/**'
711 workflow_dispatch :
8- inputs :
9- release_type :
10- type : choice
11- default : auto
12- description : What kind of version upgrade
13- options :
14- - auto
15- - patch
16- - minor
17- - major
18- - none
1912
13+ env :
14+ NPM_TAG : ' next'
15+ NX_CLOUD_ACCESS_TOKEN : ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
2016
2117jobs :
2218 release :
2319 runs-on : ubuntu-latest
20+
2421 steps :
2522 - name : Harden the runner (Audit all outbound calls)
2623 uses : step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
2724 with :
2825 egress-policy : audit
2926
30- - name : Checkout repository
31- uses : actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
32- with :
33- fetch-depth : " 0"
34- submodules : true
27+ - uses : actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
3528
36- - name : setup node
37- uses : actions/setup-node@v4
38- with :
39- node-version : lts/*
40- registry-url : ' https://registry.npmjs.org'
41-
42- - uses : oNaiPs/secrets-to-env-action@v1
43- with :
44- secrets : ${{ toJSON(secrets) }}
29+ - name : Setup
30+ run : npm run setup
4531
46- - uses : oleksiyrudenko/gha-git-credentials@8bb1fe6d543b2233ef1856cd3b0181f5abbd4d6a # v2.1.2
32+ - name : Derive appropriate SHAs for base and head for `nx affected` commands
33+ uses : nrwl/nx-set-shas@826660b82addbef3abff5fa871492ebad618c9e1 # v4.3.3
4734 with :
48- token : ' ${{ secrets.GITHUB_TOKEN }}'
49- name : Martin Guillon
50- 51-
52- - name : " NPM Identity"
53- env :
54- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
55- run : |
56- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
35+ main-branch-name : ' main'
5736
58- - name : Enable CorePack
37+ - name : Generate Version
38+ working-directory : packages/core
5939 run : |
60- corepack enable
61- yarn config get globalFolder # the yarn command will ensure the correct yarn version is downloaded and installed
40+ echo NPM_VERSION=$(node -e "console.log(require('./package.json').version);")-$NPM_TAG-$(date +"%m-%d-%Y")-$GITHUB_RUN_ID >> $GITHUB_ENV
6241
63- - name : Get yarn cache directory path
64- id : yarn-cache-dir-path
65- run : echo "::set-output name=dir::$(yarn config get globalFolder)"
42+ - name : Bump Version
43+ working-directory : packages/core
44+ run : npm version $NPM_VERSION
6645
67- - name : Install deps
68- uses : bahmutov/npm-install@v1
69- with :
70- install-command : yarn install --silent
71- env :
72- YARN_ENABLE_IMMUTABLE_INSTALLS : false
73-
46+ # TODO: build ui-mobile-base first
47+ - name : Build @nativescript/core
48+ run : npx nx build core
7449
75- - name : bump release auto
76- if : github.event.inputs.release_type == 'auto'
77- run : |
78- npm run core:changelog --
79-
80- - name : publish
81- if : github.event.inputs.release_type != 'auto' && github.event.inputs.release_type != 'none'
82- run : |
83- npm run core:changelog -- --release-as ${{ github.event.inputs.release_type }}
84-
85- - name : publish
86- run : |
87- npm run core:publish -- --no-verify-access --no-private --no-commit-hooks --force-publish --yes
88- git push --tags
50+ - name : Publish @nativescript/core
51+ working-directory : dist/packages/core
8952 env :
90- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
91- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
92- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
53+ NPM_TOKEN : ${{ secrets.NPM_PUBLISH_TOKEN }}
54+ run : |
55+ echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
56+ echo "Publishing @nativescript/core@$NPM_VERSION to NPM with tag $NPM_TAG..."
57+ npm publish --tag $NPM_TAG --access public
0 commit comments