forked from NativeScript/NativeScript
-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (39 loc) · 1.36 KB
/
npm_release_webpack.yml
File metadata and controls
49 lines (39 loc) · 1.36 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
name: '@nativescript/webpack -> npm'
permissions:
contents: read
pull-requests: write
on:
push:
branches: [ 'main' ]
paths:
- 'packages/webpack/**'
env:
NPM_TAG: 'next'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Setup
run: npm install
- name: Generate Version
working-directory: packages/webpack
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 Version
working-directory: packages/webpack
run: npm version $NPM_VERSION
- name: Build @nativescript/webpack
run: npx nx run webpack:build
- name: Publish @nativescript/webpack
working-directory: dist/packages/webpack5
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ../../.npmrc
echo "Publishing @nativescript/webpack@$NPM_VERSION to NPM with tag $NPM_TAG..."
npm publish --tag $NPM_TAG --dry-run