Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
if: github.repository == 'playcanvas/engine'
if: github.repository_owner == 'playcanvas'
steps:
- name: Check out code
uses: actions/checkout@v5
Expand Down Expand Up @@ -50,10 +50,11 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish to code.playcanvas.com
run: |
if ! curl -fsS -X POST -H "Content-Type: application/json" \
-d '{ "engineVersion": "${{ env.VERSION }}" }' ${{ secrets.PUBLISH_ENDPOINT }}; then
echo "Failed to publish to code.playcanvas.com"
exit 1
fi
- name: Write version
run: echo "${{ env.VERSION }}" > version.txt

- name: Upload version
uses: actions/upload-artifact@v4
with:
name: version
path: version.txt
29 changes: 29 additions & 0 deletions .github/workflows/upload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Upload

on:
workflow_dispatch:
workflow_run:
workflows: ["Publish"] # This must match the 'name' of the build.yml workflow
types:
- completed

jobs:
upload:
runs-on: ubuntu-latest
if: github.repository_owner == 'playcanvas' && github.event.workflow_run.conclusion == 'success'
steps:
- name: Download version
uses: actions/download-artifact@v4
with:
name: version

- name: Read version
run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV

- name: Publish to code.playcanvas.com
run: |
if ! curl -fsS -X POST -H "Content-Type: application/json" \
-d '{ "engineVersion": "${{ env.VERSION }}" }' ${{ secrets.PUBLISH_ENDPOINT }}; then
echo "Failed to publish to code.playcanvas.com"
exit 1
fi