-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (51 loc) · 1.56 KB
/
Copy pathbuild.yml
File metadata and controls
53 lines (51 loc) · 1.56 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
name: build
on:
release:
types: [created]
push:
branches:
- '**'
env:
# renovate: datasource=npm depName=npm
NPM_VERSION: '11'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version: '24.x'
cache: npm
- run: npm install -g npm@${{ env.NPM_VERSION }} --registry=https://registry.npmjs.org
- uses: microbit-foundation/npm-package-versioner-action@v3
- run: npm ci
- run: npm run ci
- run: npm pack
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: github.event_name == 'release'
with:
name: npm-tarball
path: '*.tgz'
if-no-files-found: error
retention-days: 1
publish:
needs: build
if: github.event_name == 'release'
runs-on: ubuntu-latest
environment: npm-publish
permissions:
contents: read
id-token: write
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: npm-tarball
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install -g npm@${{ env.NPM_VERSION }} --registry=https://registry.npmjs.org
- run: npm stage publish --allow-file=all ./*.tgz