-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use releases links in web demo and run actual build
- Loading branch information
Showing
1 changed file
with
80 additions
and
95 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,27 +61,22 @@ jobs: | |
with: | ||
name: WebGL-Template | ||
path: WebGL | ||
# | ||
# - name: cache Library | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: Library | ||
# key: Library-${{ matrix.targetPlatform }} | ||
# restore-keys: Library-${{ matrix.targetPlatform }} | ||
# | ||
# - name: build project for ${{ matrix.targetPlatform }} | ||
# uses: game-ci/unity-builder@v4 | ||
# env: | ||
# UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | ||
# UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | ||
# UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | ||
# with: | ||
# targetPlatform: ${{ matrix.targetPlatform }} | ||
|
||
- name: fake build | ||
run: | | ||
mkdir -p build/${{ matrix.targetPlatform }}/${{ matrix.targetPlatform }}/Build | ||
echo "fake build for ${{ matrix.targetPlatform }}" > build/${{ matrix.targetPlatform }}/${{ matrix.targetPlatform }}/Build/index.html | ||
|
||
- name: cache Library | ||
uses: actions/cache@v3 | ||
with: | ||
path: Library | ||
key: Library-${{ matrix.targetPlatform }} | ||
restore-keys: Library-${{ matrix.targetPlatform }} | ||
|
||
- name: build project for ${{ matrix.targetPlatform }} | ||
uses: game-ci/unity-builder@v4 | ||
env: | ||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | ||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | ||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | ||
with: | ||
targetPlatform: ${{ matrix.targetPlatform }} | ||
|
||
- name: upload ${{ matrix.targetPlatform }} build | ||
uses: actions/upload-artifact@v4 | ||
|
@@ -90,7 +85,6 @@ jobs: | |
name: Build-${{ matrix.targetPlatform }} | ||
path: build/${{ matrix.targetPlatform }} | ||
|
||
|
||
- name: archive ${{ matrix.targetPlatform }} release | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
run: cd build/${{ matrix.targetPlatform }} && zip -r ../../neebo-${{ github.ref_name }}-${{ matrix.targetPlatform }}.zip . | ||
|
@@ -100,24 +94,18 @@ jobs: | |
id: release | ||
with: | ||
prerelease: true | ||
name: nightly-${{ matrix.targetPlatform }} | ||
tag_name: nightly-${{ matrix.targetPlatform }} | ||
name: nightly-${{ github.event.inputs.repository }}-${{ matrix.targetPlatform }} | ||
tag_name: nightly-${{ github.event.inputs.repository }}-${{ matrix.targetPlatform }} | ||
files: neebo-${{ github.ref_name }}-${{ matrix.targetPlatform }}.zip | ||
|
||
- name: check outputs | ||
run: | | ||
echo "artifact-url: ${{ steps.upload.outputs.artifact-url }}" | ||
echo "release-download-url: ${{ steps.release.outputs.browser_download_url }}" | ||
# echo "::set-output name=artifact-url::${{ steps.upload.outputs.artifact-url }}" | ||
|
||
- name: write matrix outputs | ||
uses: cloudposse/github-action-matrix-outputs-write@main | ||
id: out | ||
with: | ||
matrix-step-name: upload | ||
matrix-step-name: release | ||
matrix-key: ${{ matrix.targetPlatform }} | ||
outputs: |- | ||
uploads: ${{ steps.upload.outputs.artifact-url }} | ||
releases: ${{ steps.release.outputs.assets }} | ||
read: | ||
runs-on: ubuntu-latest | ||
|
@@ -128,7 +116,7 @@ jobs: | |
uses: cloudposse/github-action-matrix-outputs-read@main | ||
id: read | ||
with: | ||
matrix-step-name: upload | ||
matrix-step-name: release | ||
outputs: | ||
result: ${{ steps.read.outputs.result }} | ||
|
||
|
@@ -137,65 +125,62 @@ jobs: | |
runs-on: ubuntu-latest | ||
if: ${{ github.event.inputs.deploy-to-pages == 'true' }} | ||
steps: | ||
- name: check outputs | ||
run: echo ${{ fromJson(needs.read.outputs.result) }} | ||
|
||
# - name: clone target repository | ||
# uses: actions/checkout@v4 | ||
# with: | ||
# repository: ${{ github.event.inputs.repository }} | ||
# ref: gh-pages | ||
# token: ${{ secrets.PAT_TOKEN }} | ||
# | ||
# - name: clear existing content | ||
# run: find . -path ./.git -prune -o -exec rm -rf {} \; 2> /dev/null | ||
# | ||
# - name: download webgl build | ||
# uses: actions/download-artifact@v4 | ||
# with: | ||
# name: Build-WebGL | ||
# path: . | ||
# | ||
# - name: unpack webgl build | ||
# run: | | ||
# ls -lar . | ||
# ls -lar WebGL | ||
# cp -r WebGL/Build . | ||
# rm -rf WebGL | ||
# | ||
# - name: download webgl template | ||
# uses: actions/download-artifact@v4 | ||
# with: | ||
# name: WebGL-Template | ||
# path: . | ||
# | ||
# - name: get commit hash | ||
# id: get-commit | ||
# uses: pr-mpt/actions-commit-hash@v2 | ||
# | ||
# - name: substitute env on index.html | ||
# uses: danielr1996/[email protected] | ||
# env: | ||
# LINUX_BUILD_LINK: ${{ fromJson(needs.read.outputs.result).uploads.StandaloneLinux64[0] }} | ||
# WINDOWS_BUILD_LINK: ${{ fromJson(needs.read.outputs.result).uploads.StandaloneWindows64[0] }} | ||
# | ||
# # todo: pull these from the head ref of the target repository that was just cloned | ||
# BUILD_COMMIT: ${{ steps.get-commit.outputs.short }} | ||
# BUILD_COMMIT_MESSAGE: ${{ github.event.head_commit.message }} | ||
# with: | ||
# input: ./index.html | ||
# output: ./index.html | ||
# | ||
# - name: commit static site | ||
# run: | | ||
# git config user.name github-actions | ||
# git config user.email [email protected] | ||
# git add . | ||
# git commit -m "publishing static site" | ||
# | ||
# - name: push static site to ${{ github.event.inputs.repository }} on gh-pages | ||
# uses: ad-m/github-push-action@master | ||
# with: | ||
# repository: ${{ github.event.inputs.repository }} | ||
# branch: gh-pages | ||
# github_token: ${{ secrets.PAT_TOKEN }} | ||
- name: clone target repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ github.event.inputs.repository }} | ||
ref: gh-pages | ||
token: ${{ secrets.PAT_TOKEN }} | ||
|
||
- name: clear existing content | ||
run: find . -path ./.git -prune -o -exec rm -rf {} \; 2> /dev/null | ||
|
||
- name: download webgl build | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: Build-WebGL | ||
path: . | ||
|
||
- name: unpack webgl build | ||
run: | | ||
ls -lar . | ||
ls -lar WebGL | ||
cp -r WebGL/Build . | ||
rm -rf WebGL | ||
- name: download webgl template | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: WebGL-Template | ||
path: . | ||
|
||
- name: get commit hash | ||
id: get-commit | ||
uses: pr-mpt/actions-commit-hash@v2 | ||
|
||
- name: substitute env on index.html | ||
uses: danielr1996/[email protected] | ||
env: | ||
LINUX_BUILD_LINK: ${{ fromJson(needs.read.outputs.result).releases.StandaloneLinux64[0].browser_download_url }} | ||
WINDOWS_BUILD_LINK: ${{ fromJson(needs.read.outputs.result).releases.StandaloneWindows64[0].browser_download_url }} | ||
|
||
# todo: pull these from the head ref of the target repository that was just cloned | ||
BUILD_COMMIT: ${{ steps.get-commit.outputs.short }} | ||
BUILD_COMMIT_MESSAGE: ${{ github.event.head_commit.message }} | ||
with: | ||
input: ./index.html | ||
output: ./index.html | ||
|
||
- name: commit static site | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git add . | ||
git commit -m "publishing static site" | ||
- name: push static site to ${{ github.event.inputs.repository }} on gh-pages | ||
uses: ad-m/github-push-action@master | ||
with: | ||
repository: ${{ github.event.inputs.repository }} | ||
branch: gh-pages | ||
github_token: ${{ secrets.PAT_TOKEN }} |