-
-
Notifications
You must be signed in to change notification settings - Fork 0
29 lines (29 loc) · 821 Bytes
/
publish.yml
File metadata and controls
29 lines (29 loc) · 821 Bytes
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
name: publish
on:
push:
branches: [main]
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24.x
registry-url: "https://registry.npmjs.org"
- run: |
npm i
npm run build
# check if the last release is the same as the current version
lastVersion=$(npm show @rage-against-the-pixel/unity-cli version)
version=$(node -p "require('./package.json').version")
if [ "$version" = "$lastVersion" ]; then
echo "No changes detected"
exit 0
fi
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}