Skip to content

Merge pull request #251 from zestyxyz/fix/artifact-upload-v4 #487

Merge pull request #251 from zestyxyz/fix/artifact-upload-v4

Merge pull request #251 from zestyxyz/fix/artifact-upload-v4 #487

Workflow file for this run

name: check-deploy
on:
push:
branches:
- main
jobs:
build-wle-project:
runs-on: ubuntu-latest
container:
image: wonderlandengine/editor:latest
steps:
- name: Checkout
uses: actions/checkout@v2
- run: |
npm install -g yarn
cd wonderland
yarn && yarn build
cp dist/zesty-wonderland-sdk.js ../tests/wonderland/js/
- name: Build WLE Project
run: /usr/local/bin/entrypoint.sh WonderlandEditor --windowless --package --project tests/wonderland/wonderland-test.wlp --output tests/wonderland/deploy/ --credentials $WLE_CREDENTIALS
env:
WLE_CREDENTIALS: ${{ secrets.WLE_CREDENTIALS }}
- name: Upload WLE build artifacts
uses: actions/upload-artifact@v4
with:
name: wle-build-artifacts
path: tests/wonderland/deploy/
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- run: |
chmod +x scripts/build.sh
chmod +x scripts/deploy.sh
scripts/build.sh
- name: Download WLE build artifacts
uses: actions/download-artifact@v4
with:
name: wle-build-artifacts
path: tests/wonderland/deploy/
- name: Install dependencies
run: |
npx playwright install-deps
npx playwright install
- name: Run tests
run: yarn run test
needs: build-wle-project
deploy:
runs-on: ubuntu-latest
needs: test
if: ${{ always() && (contains(needs.test.result, 'success') || contains(github.event.head_commit.message, '[test skip]')) }}
steps:
- name: Checkout
uses: actions/checkout@v2
- run: |
chmod +x scripts/build.sh
chmod +x scripts/deploy.sh
scripts/build.sh
- name: Deploy
run: |
scripts/deploy.sh
- name: Upload to S3
uses: jakejarvis/s3-sync-action@master
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1'
SOURCE_DIR: 'dist'
DEST_DIR: 'sdk'