|
1 | 1 | name: Beta |
2 | 2 |
|
3 | 3 | on: |
| 4 | + schedule: |
| 5 | + - cron: "0 2 * * *" |
4 | 6 | workflow_dispatch: |
5 | 7 | inputs: |
6 | 8 | force: |
@@ -29,28 +31,45 @@ jobs: |
29 | 31 | fetch-depth: 0 |
30 | 32 | token: ${{ steps.app-token.outputs.token }} |
31 | 33 |
|
| 34 | + - name: Set up Node.js 24.x |
| 35 | + uses: actions/setup-node@v6 |
| 36 | + with: |
| 37 | + node-version: 24.x |
| 38 | + cache: "npm" |
| 39 | + |
32 | 40 | - name: Configure Git User |
33 | 41 | run: | |
34 | 42 | git config --global user.email "playcanvas[bot]@users.noreply.github.com" |
35 | 43 | git config --global user.name "PlayCanvas [bot]" |
36 | 44 | shell: bash |
37 | 45 |
|
38 | 46 | - name: Check for changes |
39 | | - if: github.event.inputs.force == 'false' |
| 47 | + id: changes |
40 | 48 | run: | |
41 | | - last_tag=$(git describe --tags --abbrev=0) |
42 | | - if ! git diff --quiet --exit-code $last_tag; then |
43 | | - echo "Changes found since v$last_tag" |
| 49 | + if [[ "${{ github.event.inputs.force }}" == "true" ]]; then |
| 50 | + echo "has_changes=true" >> "$GITHUB_OUTPUT" |
| 51 | + exit 0 |
| 52 | + fi |
| 53 | +
|
| 54 | + last_tag=$(git describe --tags --match "v*-beta.*" --abbrev=0 2>/dev/null || true) |
| 55 | + if [[ -z "$last_tag" ]]; then |
| 56 | + echo "No beta tag found" |
| 57 | + echo "has_changes=true" >> "$GITHUB_OUTPUT" |
| 58 | + elif ! git diff --quiet --exit-code "$last_tag"..HEAD; then |
| 59 | + echo "Changes found since $last_tag" |
| 60 | + echo "has_changes=true" >> "$GITHUB_OUTPUT" |
44 | 61 | else |
45 | | - echo "No changes detected since v$last_tag" |
46 | | - exit 1 |
| 62 | + echo "No changes detected since $last_tag" |
| 63 | + echo "has_changes=false" >> "$GITHUB_OUTPUT" |
47 | 64 | fi |
48 | 65 |
|
49 | 66 | - name: Bump version |
| 67 | + if: steps.changes.outputs.has_changes == 'true' |
50 | 68 | run: | |
51 | 69 | npm version prerelease --preid=beta |
52 | 70 |
|
53 | 71 | - name: Push version |
| 72 | + if: steps.changes.outputs.has_changes == 'true' |
54 | 73 | run: | |
55 | 74 | git push origin HEAD:${{ github.ref_name }} |
56 | 75 | git push origin --tags |
|
0 commit comments