diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 10d206a09b..dd1e91093d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,8 @@ jobs: contents: write id-token: write steps: - - uses: actions/checkout@v4 + - name: Checkout Engine repo + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -32,10 +33,83 @@ jobs: registry-url: https://registry.npmjs.org/ cache: pnpm - - name: Build + - name: Build Engine run: pnpm b:all - - name: Release current monorepo + - name: Cache Engine Package + uses: actions/cache@v3 + with: + path: ./packages/galacean + key: ${{ runner.os }}-engine-${{ github.sha }} + + - name: Checkout Sub-repositories + run: | + git clone https://github.com/galacean/engine-toolkit.git + git clone https://github.com/galacean/engine-lottie.git + git clone https://github.com/galacean/engine-spine.git + + - name: Install and Link Engine and Build for Lottie + working-directory: ./engine-lottie + run: | + pwd + pnpm install --dir ${{ github.workspace }}/engine-lottie + ls . + pnpm install bezier-easing + ls . + pnpm link ../packages/galacean + pnpm build + + - name: Install and Link Engine and Build for Toolkit + working-directory: ./engine-toolkit + run: | + pwd + pnpm install + ls . + pnpm link ../packages/galacean + pnpm b:all + + + - name: Install and Link Engine and Build for Spine + working-directory: ./engine-spine + run: | + pnpm install + pnpm link ../packages/galacean + pnpm build + + - name: Ensure Dist Directory Exists + run: mkdir -p ${{ github.workspace }}/platform-adapter/dist + + # Create a mock package.json to specify the path and version of the adapter build result when syncing with the CDN later. + # name is set to @galacean/engine-platform-adapter-release to avoid conflicts with the real package.json + # version is set to the version of the engine package + - name: Create package.json in platform-adapter + run: | + VERSION=$(jq -r '.version' ${{ github.workspace }}/packages/galacean/package.json) + echo "{\"name\": \"@galacean/engine-platform-adapter-release\", \"version\": \"$VERSION\"}" > ${{ github.workspace }}/platform-adapter/package.json + + - name: Bundle polyfill and engine + uses: galacean/platform-adapter@main + env: + ADAPTER_BUNDLE_SETTINGS: | + { + "polyfill": true, + "engine": [ + "${{ github.workspace }}/packages/galacean/dist/module.js", + "${{ github.workspace }}/packages/xr/dist/module.js", + "${{ github.workspace }}/packages/shader-lab/dist/module.js", + "${{ github.workspace }}/packages/physics-lite/dist/module.js", + "${{ github.workspace }}/packages/physics-physx/dist/module.js", + "${{ github.workspace }}/engine-lottie/dist/module.js", + "${{ github.workspace }}/engine-spine/dist/module.js", + "${{ github.workspace }}/engine-toolkit/galacean-engine-toolkit/dist/module.js" + ], + "jsWASMLoader": [ + "${{ github.workspace }}/packages/physics-physx/libs/physx.release.js" + ], + "outputDir": "${{ github.workspace }}/platform-adapter/dist" + } + + - name: Release engine packages and Sync to CDN uses: galacean/publish@v0.2.0 env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} @@ -43,3 +117,17 @@ jobs: OASISBE_UPLOAD_URL: https://oasisbe.alipay.com/api/file/no-auth/crypto/upload OASISBE_REQUEST_HEADER: ${{secrets.OASISBE_REQUEST_HEADER}} OASISBE_PUBLIC_KEY: ${{secrets.OASISBE_PUBLIC_KEY}} + + - name: Sync Platform Adapter to CDN + uses: galacean/publish@v0.2.0 + with: + publish: false + packages: | + platform-adapter + + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + NPM_CONFIG_PROVENANCE: true + OASISBE_UPLOAD_URL: https://oasisbe.alipay.com/api/file/no-auth/crypto/upload + OASISBE_REQUEST_HEADER: ${{secrets.OASISBE_REQUEST_HEADER}} + OASISBE_PUBLIC_KEY: ${{secrets.OASISBE_PUBLIC_KEY}} diff --git a/package.json b/package.json index 0aa6402923..00ee05355b 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "release": "bumpp -r" }, "devDependencies": { + "@actions/core": "^1.11.1", "@commitlint/cli": "^11.0.0", "@commitlint/config-conventional": "^11.0.0", "@rollup/plugin-commonjs": "^17.0.0", diff --git a/packages/core/src/audio.ts b/packages/core/src/audio.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e5f8db82b6..0389a9a03b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: devDependencies: + '@actions/core': + specifier: ^1.11.1 + version: 1.11.1 '@commitlint/cli': specifier: ^11.0.0 version: 11.0.0 @@ -305,6 +308,18 @@ importers: packages: + '@actions/core@1.11.1': + resolution: {integrity: sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==} + + '@actions/exec@1.1.1': + resolution: {integrity: sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==} + + '@actions/http-client@2.2.3': + resolution: {integrity: sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==} + + '@actions/io@1.1.3': + resolution: {integrity: sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==} + '@ampproject/remapping@2.3.0': resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} @@ -644,6 +659,10 @@ packages: resolution: {integrity: sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@fastify/busboy@2.1.1': + resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} + engines: {node: '>=14'} + '@fastify/deepmerge@1.3.0': resolution: {integrity: sha512-J8TOSBq3SoZbDhM9+R/u77hP93gz/rajSA+K2kGyijPpORPWUXHUpTaleoj+92As0S9uPRP7Oi8IqMf0u+ro6A==} @@ -4011,6 +4030,10 @@ packages: undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + undici@5.28.4: + resolution: {integrity: sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==} + engines: {node: '>=14.0'} + universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} @@ -4283,6 +4306,22 @@ packages: snapshots: + '@actions/core@1.11.1': + dependencies: + '@actions/exec': 1.1.1 + '@actions/http-client': 2.2.3 + + '@actions/exec@1.1.1': + dependencies: + '@actions/io': 1.1.3 + + '@actions/http-client@2.2.3': + dependencies: + tunnel: 0.0.6 + undici: 5.28.4 + + '@actions/io@1.1.3': {} + '@ampproject/remapping@2.3.0': dependencies: '@jridgewell/gen-mapping': 0.3.5 @@ -4645,6 +4684,8 @@ snapshots: '@eslint/js@8.57.1': {} + '@fastify/busboy@2.1.1': {} + '@fastify/deepmerge@1.3.0': {} '@galacean/engine-toolkit-auxiliary-lines@1.3.9(@galacean/engine@packages+galacean)': @@ -8076,8 +8117,7 @@ snapshots: dependencies: safe-buffer: 5.2.1 - tunnel@0.0.6: - optional: true + tunnel@0.0.6: {} tweetnacl@0.14.5: {} @@ -8114,6 +8154,10 @@ snapshots: undici-types@5.26.5: {} + undici@5.28.4: + dependencies: + '@fastify/busboy': 2.1.1 + universalify@0.1.2: {} universalify@0.2.0: {} diff --git a/test.js b/test.js new file mode 100644 index 0000000000..e69de29bb2