update readme and prepare for release #74
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: build web | |
on: | |
push: {tags: ['v*']} # Push events to matching v*, i.e. v1.0, v20.15.10 | |
pull_request: | |
permissions: | |
contents: write | |
env: | |
EMSDK: /opt/emsdk | |
BUILD_NAME: onsyuri_web | |
jobs: | |
install_emsdk: | |
runs-on: ubuntu-20.04 # default batch, powershell | |
steps: | |
- uses: actions/checkout@v3 | |
- name: check or make emsdk cache | |
id: check_emsdk | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.EMSDK }} | |
key: emsdk | |
- name: install emsdk | |
if: steps.check_emsdk.outputs.cache-hit != 'true' | |
run: | | |
git clone https://github.com/emscripten-core/emsdk.git ${{ env.EMSDK }} | |
cd ${{ env.EMSDK }} | |
./emsdk install latest && ./emsdk activate latest | |
source ./emsdk_env.sh | |
embuilder build sdl2 sdl2_ttf sdl2_image sdl2_mixer bzip2 ogg vorbis mpg123 | |
build_web: | |
runs-on: ubuntu-20.04 | |
needs: install_emsdk | |
steps: | |
- uses: actions/checkout@v3 | |
- name: get emsdk cache | |
uses: actions/cache@v3 | |
with: | |
key: emsdk | |
path: ${{ env.EMSDK }} | |
- name: build onsyuri_web | |
run: cd script && export EMCSDK=${{ env.EMCSDK }} && bash ./cross_web.sh | |
- name: prepare release | |
if: github.event_name == 'push' | |
run: | | |
cd build_web | |
mkdir ${{ env.BUILD_NAME }} | |
cp onsyuri{.html,.js,.wasm} ${{ env.BUILD_NAME }}/ | |
cp onsyuri_index.py ${{ env.BUILD_NAME }}/ | |
7z a -t7z -mtc=on -ms=off -mx=5 -m0=lzma2 ${{ env.BUILD_NAME }}.7z ${{ env.BUILD_NAME }} | |
mv ${{ env.BUILD_NAME }}.7z onsyuri_${{ github.ref_name }}_web.7z | |
- name: create release | |
uses: ncipollo/release-action@v1 | |
if: github.event_name == 'push' | |
with: | |
artifacts: "./build_web/onsyuri_${{ github.ref_name }}_web.7z" | |
allowUpdates: "true" | |
token: ${{ secrets.GITHUB_TOKEN }} |