-
Notifications
You must be signed in to change notification settings - Fork 4
59 lines (50 loc) · 1.64 KB
/
Copy pathpublish.yml
File metadata and controls
59 lines (50 loc) · 1.64 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
name: Publish
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'playcanvas' }}
permissions:
contents: write
id-token: write
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 24.x
cache: 'npm'
registry-url: 'https://registry.npmjs.org/'
- name: Parse tag name
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
echo "TAG=${TAG_NAME}" >> $GITHUB_ENV
- name: Install Dependencies
run: npm ci
- name: Build PlayCanvas ESLint Config
run: npm run build
env:
NODE_ENV: production
- name: Run Publint
run: npm run publint
- name: Publish to npm
run: |
if [[ "${{ env.TAG }}" =~ "beta" ]]; then
tag=beta
else
tag=latest
fi
npm publish --tag $tag --provenance
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
generate_release_notes: true
prerelease: ${{ contains(github.ref, 'beta') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}