Skip to content

Commit 3e22abf

Browse files
committed
feat: add pnpm and changesets to manage repository
1 parent 7bad78a commit 3e22abf

34 files changed

+1316
-4185
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": [
11+
"@godot-js/jsb-static",
12+
"@godot-js/jsb-runtime",
13+
"@godot-js/jsb-editor"
14+
]
15+
}

.github/workflows/android_builds.yml renamed to .github/workflows/builds/android.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ jobs:
6767
name: V8
6868
path: ${{github.workspace}}/modules/GodotJS/v8
6969

70+
- name: Download out
71+
uses: actions/download-artifact@v4
72+
with:
73+
name: out
74+
path: ${{github.workspace}}/modules/GodotJS/scripts/out
75+
7076
- name: Setup Python and SCons
7177
uses: ./.github/actions/godot-deps
7278

.github/workflows/ios_builds.yml renamed to .github/workflows/builds/ios.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ jobs:
6161
name: V8
6262
path: ${{github.workspace}}/modules/GodotJS/v8
6363

64+
- name: Download out
65+
uses: actions/download-artifact@v4
66+
with:
67+
name: out
68+
path: ${{github.workspace}}/modules/GodotJS/scripts/out
69+
6470
- name: Setup Python and SCons
6571
uses: ./.github/actions/godot-deps
6672

.github/workflows/linux_builds.yml renamed to .github/workflows/builds/linux.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ jobs:
9696
name: V8
9797
path: ${{github.workspace}}/modules/GodotJS/v8
9898

99+
- name: Download out
100+
uses: actions/download-artifact@v4
101+
with:
102+
name: out
103+
path: ${{github.workspace}}/modules/GodotJS/scripts/out
104+
99105
- name: Setup Python and SCons
100106
if: "!matrix.legacy-scons"
101107
uses: ./.github/actions/godot-deps

.github/workflows/macos_builds.yml renamed to .github/workflows/builds/macos.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ jobs:
8989
name: V8
9090
path: ${{github.workspace}}/modules/GodotJS/v8
9191

92+
- name: Download out
93+
uses: actions/download-artifact@v4
94+
with:
95+
name: out
96+
path: ${{github.workspace}}/modules/GodotJS/scripts/out
97+
9298
- name: Compilation (x86_64)
9399
uses: ./.github/actions/godot-build
94100
with:

.github/workflows/web_builds.yml renamed to .github/workflows/builds/web.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ jobs:
5555
lfs: true
5656
submodules: recursive
5757

58+
- name: Download out
59+
uses: actions/download-artifact@v4
60+
with:
61+
name: out
62+
path: ${{github.workspace}}/modules/GodotJS/scripts/out
63+
5864
- name: Set up Emscripten latest
5965
uses: mymindstorm/setup-emsdk@v14
6066
with:

.github/workflows/windows_builds.yml renamed to .github/workflows/builds/windows.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ jobs:
9191
name: V8
9292
path: ${{github.workspace}}/modules/GodotJS/v8
9393

94+
- name: Download out
95+
uses: actions/download-artifact@v4
96+
with:
97+
name: out
98+
path: ${{github.workspace}}/modules/GodotJS/scripts/out
99+
94100
- name: Setup Python and SCons
95101
uses: ./.github/actions/godot-deps
96102

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: 🌳 Set Environment
2+
on:
3+
workflow_call:
4+
outputs:
5+
version:
6+
description: "Godot version"
7+
value: ${{ jobs.environment.outputs.version }}
8+
v8:
9+
description: "V8 version"
10+
value: ${{ jobs.environment.outputs.v8 }}
11+
publish:
12+
description: "Should publish"
13+
value: ${{ jobs.environment.outputs.publish }}
14+
15+
jobs:
16+
environment:
17+
name: 🌳 Set Environment
18+
runs-on: ubuntu-latest
19+
outputs:
20+
version: ${{ steps.versions.outputs.version }}
21+
v8: ${{ steps.versions.outputs.v8 }}
22+
publish: ${{ steps.should_publish.outputs.publish }}
23+
steps:
24+
- name: ⏬ Checkout repository
25+
uses: actions/checkout@v4
26+
27+
- name: 🛫 Setup pnpm
28+
uses: pnpm/action-setup@v4
29+
30+
- name: 🦕❌ Setup node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: 20
34+
cache: "pnpm"
35+
36+
- name: 🛠️ Build scripts/out
37+
run: |
38+
pnpm install
39+
pnpm build
40+
41+
- name: ⬆️ Upload scripts/out
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: out
45+
path: ${{github.workspace}}/modules/GodotJS/scripts/out
46+
retention-days: 10
47+
48+
- name: 🏷 Set Versions
49+
id: versions
50+
run: |
51+
echo "version=4.4" >> $GITHUB_OUTPUT
52+
echo "v8=v8_12.4.254.21_r13" >> $GITHUB_OUTPUT
53+
54+
- name: 🎱 Deps v8
55+
shell: bash
56+
env:
57+
V8: ${{ steps.versions.outputs.v8 }}
58+
run: |
59+
curl -L -o "$V8.zip" "https://github.com/ialex32x/GodotJS-Dependencies/releases/download/$V8/$V8.zip"
60+
unzip "$V8.zip" -d "/tmp/$V8"
61+
mkdir -p "${{github.workspace}}/modules/GodotJS/"
62+
mv "/tmp/$V8/v8" "${{github.workspace}}/modules/GodotJS/v8"
63+
ls "${{github.workspace}}/modules/GodotJS/v8"
64+
65+
- name: ⬆️ Upload v8
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: V8
69+
path: ${{github.workspace}}/modules/GodotJS/v8
70+
retention-days: 10
71+
72+
- name: 🆚 Create and publish versions
73+
id: changesets
74+
uses: changesets/action@v1
75+
with:
76+
commit: "chore: update versions"
77+
title: "chore: update versions"
78+
version: pnpm ci:version
79+
env:
80+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
82+
- name: ❓ Should publish
83+
id: should_publish
84+
env:
85+
HAS_CHANGESETS: ${{ steps.changesets.outputs.hasChangesets }}
86+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
run: |
88+
SHOULD_PUBLISH=$(pnpm run ci:should-publish)
89+
if [[ $SHOULD_PUBLISH == "true" && $HAS_CHANGESETS == "false" ]]; then
90+
echo "publish=true" >> $GITHUB_OUTPUT
91+
else
92+
echo "publish=false" >> $GITHUB_OUTPUT
93+
fi

.github/workflows/release_builds.yml renamed to .github/workflows/misc/release.yml

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,43 @@ permissions:
1313
contents: write
1414

1515
jobs:
16-
rename:
16+
release:
1717
runs-on: ubuntu-latest
18+
outputs:
19+
id: ${{ steps.publish_release.outputs.id }}
1820
steps:
1921
- name: ⏬ Checkout repo
2022
uses: actions/checkout@v4
2123

22-
- name: 📛 Add version to release name
23-
uses: actions/github-script@v6
24+
- name: 🛫 Setup pnpm
25+
uses: pnpm/action-setup@v4
26+
27+
- name: 🦕❌ Setup node.js
28+
uses: actions/setup-node@v4
2429
with:
25-
result-encoding: json
26-
script: |
27-
const { repo, owner } = context.repo;
28-
await github.rest.repos.updateRelease({
29-
owner,
30-
repo,
31-
release_id: context.payload.release.id,
32-
name: '${{ inputs.version }}-${{ inputs.v8 }}-' + context.payload.release.name,
33-
});
30+
node-version: 20
31+
cache: "pnpm"
3432

35-
release:
33+
- name: 🔄️ Install dependencies
34+
run: pnpm install
35+
36+
- name: 🚢 Publish release
37+
id: publish_release
38+
env:
39+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
run: |
41+
pnpm ci:publish ${{ inputs.version }} ${{ inputs.v8 }}
42+
RELEASE_ID=$(gh release view ${{ inputs.version }} --json id --jq ".id")
43+
echo "id=$RELEASE_ID" >> $GITHUB_OUTPUT
44+
45+
upload-assets:
3646
runs-on: ubuntu-latest
3747
name: ${{ matrix.os }}-${{ matrix.target }}-${{ matrix.engine }}
48+
needs: [ release ]
3849
strategy:
3950
fail-fast: false
4051
matrix:
41-
engine: [ v8,qjs-ng ]
52+
engine: [ v8, qjs-ng ]
4253
os: [ android, ios, linux, macos, web, web-nothreads, windows ]
4354
target: [ template-release ]
4455
include:
@@ -87,7 +98,7 @@ jobs:
8798
return await github.rest.repos.uploadReleaseAsset({
8899
owner,
89100
repo,
90-
release_id: context.payload.release.id,
101+
release_id: ${{ needs.release.outputs.id }},
91102
name: '${{ steps.name.outputs.name }}.zip',
92103
data: FS.readFileSync('${{ github.workspace }}/${{ steps.name.outputs.name }}.zip')
93104
});

0 commit comments

Comments
 (0)