-
Notifications
You must be signed in to change notification settings - Fork 5
81 lines (68 loc) · 2.41 KB
/
Copy pathpackage-webkit.yml
File metadata and controls
81 lines (68 loc) · 2.41 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
name: Publish @aziontech/webkit to NPM
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: 'Release tag to publish (e.g. @aziontech/webkit@4.3.0)'
required: true
type: string
permissions: {}
concurrency:
group: publish-webkit
cancel-in-progress: false
jobs:
publish:
name: Build and publish to npm
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, '@aziontech/webkit@')
permissions:
contents: read
id-token: write
steps:
- name: Resolve release tag
id: tag
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
DISPATCH_TAG: ${{ inputs.tag }}
run: |
TAG="${RELEASE_TAG:-$DISPATCH_TAG}"
case "$TAG" in
"@aziontech/webkit@"*) ;;
*) echo "Not a @aziontech/webkit release tag: $TAG" >&2; exit 1 ;;
esac
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "version=${TAG##*@}" >> "$GITHUB_OUTPUT"
- name: Checkout release tag
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ steps.tag.outputs.tag }}
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
- name: Setup pnpm
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
- name: Install workspace dependencies
run: pnpm install --frozen-lockfile
- name: Verify package.json matches the tag
working-directory: packages/webkit
env:
EXPECTED: ${{ steps.tag.outputs.version }}
run: |
ACTUAL="$(node -p "require('./package.json').version")"
if [ "$ACTUAL" != "$EXPECTED" ]; then
echo "package.json version ($ACTUAL) does not match the tag version ($EXPECTED)." >&2
exit 1
fi
- name: Build
working-directory: packages/webkit
run: node scripts/build-catalog.mjs && pnpm exec vue-tsc --declaration --emitDeclarationOnly
- name: Publish to npm
working-directory: packages/webkit
run: npm publish --provenance --access public
env:
NPM_CONFIG_PROVENANCE: true