-
-
Notifications
You must be signed in to change notification settings - Fork 15
56 lines (56 loc) · 1.53 KB
/
build.yml
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
name: Build and upload bundle
on:
release:
types: [published]
push:
pull_request:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22.x
- run: npm clean-install
- run: npm run build
- run: node_modules/.bin/esbuild --target=es2022 --bundle --minify --outfile=typage.js --global-name=age age-encryption
- uses: actions/upload-artifact@v4
with:
name: age-esbuild
path: typage.js
upload:
if: github.event_name == 'release'
needs: build
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: age-esbuild
- run: gh release upload -R FiloSottile/typage "$VERSION" "typage.js#age-${VERSION#v}.min.js"
env:
VERSION: ${{ github.event.release.tag_name }}
GH_TOKEN: ${{ github.token }}
publish:
if: github.event_name == 'release'
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22.x
registry-url: "https://registry.npmjs.org"
- run: npm clean-install
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}