Skip to content

Commit 80b31f7

Browse files
authored
Beta builds (manual trigger) (#7798)
* Rename workflow from "Publish to npm" to "Publish" * WIP: nightly workflow * Add optional input for test execution in nightly workflow * WIP: Converted manual workflow to on push for testing * Add Git user configuration step to nightly workflow * Add steps to push changes and tags after version bump in nightly workflow * Fix GitHub Action user name in nightly workflow configuration * Updated job name and limited to just run on main * Updated publish name and allow publishing from dev * Combined push commit and tag * Manual nightly build * Removed storing version in env * Add change detection step to nightly workflow * Added quiet flag to suppress changes * Make workflow fail if no changes found with input override * Fix newline issue at end of file in nightly workflow * Fix fetch-depth configuration in nightly workflow * Fix conditional syntax in nightly workflow change detection * Changed tag from nightly to beta * Update Node.js version to 22.x in CI and publish workflows
1 parent 504d502 commit 80b31f7

File tree

6 files changed

+68
-9
lines changed

6 files changed

+68
-9
lines changed

.github/workflows/beta.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Beta
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
force:
7+
description: 'Force release even if no changes detected'
8+
type: boolean
9+
default: false
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
beta:
16+
runs-on: ubuntu-latest
17+
if: github.repository == 'playcanvas/engine' && github.ref_name == 'main'
18+
steps:
19+
- name: Check out code
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Set up Node.js 22.x
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 22.x
28+
cache: 'npm'
29+
registry-url: 'https://registry.npmjs.org/'
30+
31+
- name: Configure Git User
32+
run: |
33+
git config --global user.email "[email protected]"
34+
git config --global user.name "GitHub Action"
35+
shell: bash
36+
37+
- name: Check for changes
38+
if: github.event.inputs.force == 'false'
39+
run: |
40+
last_tag=$(git describe --tags --abbrev=0)
41+
if ! git diff --quiet --exit-code $last_tag; then
42+
echo "Changes found since v$last_tag"
43+
else
44+
echo "No changes detected since v$last_tag"
45+
exit 1
46+
fi
47+
48+
- name: Bump version
49+
run: |
50+
npm version prerelease --preid=beta
51+
52+
- name: Push version
53+
run: |
54+
git push origin HEAD:${{ github.ref_name }}
55+
git push origin --tags
56+
shell: bash

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Checkout code
2424
uses: actions/checkout@v4
2525

26-
- name: Setup Node.js 18.x
26+
- name: Setup Node.js 22.x
2727
uses: actions/setup-node@v4
2828
with:
2929
node-version: 22.x

.github/workflows/publish.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
name: Publish to npm
1+
name: Publish
22

33
on:
44
push:
55
tags:
66
- 'v[0-9]+.[0-9]+.[0-9]+'
77
- 'v[0-9]+.[0-9]+.[0-9]+-preview.[0-9]+'
8+
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'
89

910
jobs:
10-
publish-npm:
11+
publish:
1112
runs-on: ubuntu-latest
1213
if: github.repository == 'playcanvas/engine'
1314
steps:
1415
- name: Check out code
1516
uses: actions/checkout@v4
1617

17-
- name: Set up Node.js 18.x
18+
- name: Set up Node.js 22.x
1819
uses: actions/setup-node@v4
1920
with:
2021
node-version: 22.x
@@ -40,6 +41,8 @@ jobs:
4041
run: |
4142
if [[ "${{ env.TAG }}" =~ "preview" ]]; then
4243
tag=preview
44+
elif [[ "${{ env.TAG }}" =~ "beta" ]]; then
45+
tag=beta
4346
else
4447
tag=latest
4548
fi

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "playcanvas",
3-
"version": "2.9.0-dev.0",
3+
"version": "2.9.0-beta.0",
44
"author": "PlayCanvas <[email protected]>",
55
"homepage": "https://playcanvas.com",
66
"description": "PlayCanvas WebGL game engine",

release.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
MAIN_BRANCH="main"
44

5-
PRE_ID_DEV="dev"
5+
PRE_ID_BETA="beta"
66
PRE_ID_PREVIEW="preview"
77

88
RELEASE_PREFIX="release-"
@@ -64,7 +64,7 @@ if [[ "$BRANCH" == "$MAIN_BRANCH" ]]; then
6464
git branch "$RELEASE_BRANCH" "$BRANCH"
6565

6666
# Bump minor prerelease version on main
67-
npm version preminor --preid=$PRE_ID_DEV --no-git-tag-version
67+
npm version preminor --preid=$PRE_ID_BETA --no-git-tag-version
6868
git commit -m "$RELEASE_MESSAGE" -- package.json package-lock.json
6969

7070
# Switch to release branch

0 commit comments

Comments
 (0)