Skip to content

Commit 825a78b

Browse files
kpal81xdCopilot
andauthored
Release script update (#7663)
* removed dev from version * Add CommonJS support to ESLint config and improve console log formatting in release script * WIP: release script updated version * Fix release script to use current branch name and improve branch handling logic * Simplify finalization prompt in release script by removing tag existence check * Add git fetch command to ensure remote tags are available before finalizing release * Refactor condition check for branch type in release script * Add comments to clarify branch checks in release script * Normalize prompt responses in release script for consistency * Changed main branch to main * Enhance help message and usage instructions in release script * Add comment to clarify release type determination in release script * Update prompt message for finalizing release to include release type * Refactor release script to improve prompt message and ensure prerelease tagging * Refactor release script to use variables for prerelease identifiers and improve version calculation logic * Add checks for uncommitted changes and streamline version calculation in release script * Update publish workflow to use 'preview' tag instead of 'alpha' for pre-release versions * Remove npm version command from pre-release tag detection in publish workflow * Add publishing step to code.playcanvas.com in workflow * Fix engine version variable in PlayCanvas publish step * Refactor tag parsing and publishing logic in workflow * Fix tag condition in npm publish step to use regex for preview detection * Add silent flag to curl command for PlayCanvas publishing step * Fix curl command in PlayCanvas publishing step to handle errors * Remove deprecated CommonJS configuration and release script * fix: Update PlayCanvas publish endpoint to use secret variable * Update .github/workflows/publish.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update release.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update release.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update release.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 1e6664d commit 825a78b

File tree

5 files changed

+126
-257
lines changed

5 files changed

+126
-257
lines changed

.github/workflows/publish.yaml

+20-12
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
tags:
66
- 'v[0-9]+.[0-9]+.[0-9]+'
7-
- 'v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+'
7+
- 'v[0-9]+.[0-9]+.[0-9]+-preview.[0-9]+'
88

99
jobs:
1010
publish-npm:
@@ -20,17 +20,11 @@ jobs:
2020
cache: 'npm'
2121
registry-url: 'https://registry.npmjs.org/'
2222

23-
- name: Determine pre-release tag
24-
id: release-tag
23+
- name: Parse tag name
2524
run: |
2625
TAG_NAME=${GITHUB_REF#refs/tags/}
27-
echo "Detected tag: $TAG_NAME"
28-
if [[ "$TAG_NAME" == *-alpha.* ]]; then
29-
echo "tag=alpha" >> $GITHUB_ENV
30-
npm version --no-git-tag-version $TAG_NAME
31-
else
32-
echo "tag=latest" >> $GITHUB_ENV
33-
fi
26+
echo "TAG=${TAG_NAME}" >> $GITHUB_ENV
27+
echo "VERSION=${TAG_NAME/v/}" >> $GITHUB_ENV
3428
3529
- name: Install Dependencies
3630
run: npm install
@@ -42,6 +36,20 @@ jobs:
4236
run: npm run publint
4337

4438
- name: Publish to npm
45-
run: npm publish --tag ${{ env.tag }}
39+
run: |
40+
if [[ "${{ env.TAG }}" =~ "preview" ]]; then
41+
tag=preview
42+
else
43+
tag=latest
44+
fi
45+
npm publish --tag $tag
4646
env:
47-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
47+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
48+
49+
- name: Publish to code.playcanvas.com
50+
run: |
51+
if ! curl -sS -X POST -H "Content-Type: application/json" \
52+
-d '{ "engineVersion": "${{ env.VERSION }}" }' ${{ secrets.PUBLISH_ENDPOINT }}; then
53+
echo "Failed to publish to code.playcanvas.com"
54+
exit 1
55+
fi

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "playcanvas",
3-
"version": "2.8.0-dev",
3+
"version": "2.8.0-dev.0",
44
"author": "PlayCanvas <support@playcanvas.com>",
55
"homepage": "https://playcanvas.com",
66
"description": "PlayCanvas WebGL game engine",

release.cjs

-242
This file was deleted.

0 commit comments

Comments
 (0)