Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto-generate docs and auto-publish | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
environment: Main | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- run: npm ci | |
- run: npm run build | |
- run: tar -czf build.tar.gz dist/ | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: build | |
path: build.tar.gz | |
retention-days: 1 | |
overwrite: true | |
test: | |
environment: Main | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- run: npm ci | |
- run: npm run lint | |
- run: npm run test | |
build-project: | |
needs: [build, test] | |
environment: Main | |
runs-on: ubuntu-latest | |
container: | |
image: wonderlandengine/editor:1.1.6 | |
steps: | |
# XXX libatomic is missing. looks like WLE github CI is outdated | |
- run: apt-get install -y libatomic1 | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- run: npm ci | |
- run: | | |
cd example-project | |
npm ci | |
cd .. | |
- name: Download build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: build | |
- run: tar -xf build.tar.gz dist/ | |
# just naming this step because im scared that the credentials will get printed | |
- name: Package with Wonderland Engine Editor | |
run: /usr/local/bin/entrypoint.sh WonderlandEditor --windowless --package --project example-project/example-project.wlp --credentials "$WLE_CREDENTIALS" | |
env: | |
WLE_CREDENTIALS: ${{ secrets.WLE_CREDENTIALS }} | |
- run: tar -czf project-build.tar.gz example-project/deploy/* | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: project-build | |
path: project-build.tar.gz | |
retention-days: 1 | |
overwrite: true | |
generate-docs: | |
needs: [build, test, build-project] | |
environment: Main | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- run: npm ci | |
- run: npm run docs | |
- name: Download build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: build | |
- run: tar -xf build.tar.gz dist/ | |
- name: Download project build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: project-build | |
- run: tar -xf project-build.tar.gz example-project/ | |
- run: mv dist docs/dist | |
- run: mv example-project/deploy docs/example-project | |
- uses: actions/upload-pages-artifact@v3 | |
with: | |
path: 'docs/' | |
deploy-docs: | |
if: startsWith(github.ref, 'refs/tags/releases/') | |
needs: generate-docs | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
publish-npm: | |
if: startsWith(github.ref, 'refs/tags/releases/') | |
needs: deploy-docs | |
environment: Main | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
registry-url: https://registry.npmjs.org/ | |
- name: Download build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: build | |
- run: tar -xf build.tar.gz dist/ | |
- run: npm ci | |
- run: npm pack | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: lazy-widgets-wle-[0-9]*.[0-9]*.[0-9]*.tgz | |
file_glob: true | |
- run: npm publish --no-git-checks | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.npm_token}} |