Recompile Emscripten #1
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: Update Game Data and Recompile wasm | |
on: | |
workflow_dispatch: | |
push: | |
paths-ignore: | |
- 'data/**' | |
- 'build_js/**' | |
jobs: | |
update: | |
continue-on-error: false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Update Game Data | |
run: python data/checkUpdate.py | |
- name: Commit files | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add data -f | |
git commit -m "Update Game Data" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} | |
recompile-ems: | |
runs-on: ubuntu-latest | |
needs: update | |
if: ${{ !cancelled() }} | |
steps: | |
- uses: mymindstorm/setup-emsdk@v13 | |
with: | |
version: 3.1.47 | |
- name: version | |
run: emcc --version | |
- uses: actions/checkout@v2 | |
- run: git pull | |
- run: sed -zi 's/\n//g' data/data.min.json | |
- run: sed -zi 's/ //g' data/data.min.json | |
- name: Recompile | |
run: | | |
cd build_js | |
emcmake cmake .. -DCMAKE_BUILD_TYPE=Release | |
emmake make | |
- name: Commit files | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add build_js | |
git commit -m "Recompile Emscripten" | |
- name: Remove CmakeFiles | |
run: | | |
rm -rf build_js/CMakeFiles | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} | |
push-to-Web: | |
runs-on: ubuntu-latest | |
needs: recompile-ems | |
if: ${{ !cancelled() }} | |
steps: | |
- uses: actions/checkout@v2 | |
- run: git pull | |
- name: Deploy to external repository | |
uses: cpina/github-action-push-to-another-repository@main | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.bcjh_web }} | |
with: | |
# GitHub Action output files | |
source-directory: build_js/ | |
destination-github-username: hjenryin | |
destination-repository-name: BCJH-Metropolis-html | |
user-email: 41898282+github-actions[bot]@users.noreply.github.com | |
# It defaults to `main` | |
target-branch: "test-emscripten" | |
target-directory: "js/upload" | |
# Use the same commit message as $ORIGIN_REPOSITORY_URL@commit 's | |
commit-message: ${{ github.event.head_commit.message }}. (From $ORIGIN_REPOSITORY_URL@commit) | |
push-to-debug: | |
runs-on: ubuntu-latest | |
needs: push-to-Web | |
# Makes sure that when the debug page is ready, the main page is also ready | |
if: ${{ !cancelled() }} | |
steps: | |
- uses: mymindstorm/setup-emsdk@v13 | |
with: | |
version: 3.1.56 | |
- name: version | |
run: emcc --version | |
- uses: actions/checkout@v2 | |
- run: git pull | |
- run: sed -zi 's/\n//g' data/data.min.json | |
- run: sed -zi 's/ //g' data/data.min.json | |
- name: Recompile | |
run: | | |
cd build_js | |
emcmake cmake .. -DCMAKE_BUILD_TYPE=Debug | |
emmake make | |
- name: Remove CmakeFiles | |
run: | | |
rm -rf build_js/CMakeFiles | |
- name: Deploy to external repository | |
uses: cpina/github-action-push-to-another-repository@main | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.bcjh_web }} | |
with: | |
# GitHub Action output files | |
source-directory: build_js/ | |
destination-github-username: hjenryin | |
destination-repository-name: BCJH-Metropolis-html | |
user-email: 41898282+github-actions[bot]@users.noreply.github.com | |
# It defaults to `main` | |
target-branch: "debug-online" | |
target-directory: "js/upload" | |
commit-message: ${{ github.event.head_commit.message }}. (From $ORIGIN_REPOSITORY_URL@commit) | |