Skip to content

Restore accidentally deleted line in workflow #59

Restore accidentally deleted line in workflow

Restore accidentally deleted line in workflow #59

Workflow file for this run

# - Creates a release on matching tag push
# - builds new emscripten wasm
# - uploads release assets
# - updates lavavu.github.io repo
name: Publish
# Build on every branch push, tag push, and pull request change where tag matches a version release
on:
workflow_dispatch:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: mymindstorm/setup-emsdk@v7
- name: Verify
run: emcc -v
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install prereqs
run: python -m pip install -r requirements.txt
- name: Build/install
run: make emscripten
- name: Zip
run: |
zip --junk-paths LavaVu-web ./lavavu/html/webview.html ./lavavu/html/LavaVu.wasm ./lavavu/html/LavaVu.data ./lavavu/html/LavaVu-amalgamated.js ./lavavu/html/LavaVu-amalgamated.css
# https://github.community/t/how-to-get-just-the-tag-name/16241/6
- name: Get the version
id: get_version
run: |
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
echo ::set-output name=VERSIONSTR::v${GITHUB_REF/refs\/tags\//}
- name: Create release
id: upload-release-asset
uses: svenstaro/upload-release-action@v2
with:
#This will not trigger "publish" actions if we use GITHUB_TOKEN
#See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token
#repo_token: ${{ secrets.GITHUB_TOKEN }}
repo_token: ${{ secrets.LAVAVU_PUSH }}
file: LavaVu-web.zip
asset_name: LavaVu-web-$tag.zip
tag: ${{ github.ref }} #Use current tag/ref
overwrite: true
body: "Release LavaVu ${{ steps.get_version.outputs.VERSIONSTR }}"
release_name: ${{ steps.get_version.outputs.VERSIONSTR }}
- name: Push files to lavavu.github.io
env:
API_TOKEN_GITHUB: ${{ secrets.LAVAVU_PUSH }}
run: |
git config --global user.name "okaluza"
git config --global user.email "owen.kaluza@monash.edu"
git clone --depth 1 --single-branch --branch main https://$API_TOKEN_GITHUB@github.com/lavavu/lavavu.github.io
cd lavavu.github.io
git checkout main
cp ../lavavu/html/webview.html .
cp ../lavavu/html/LavaVu.wasm .
cp ../lavavu/html/LavaVu.data .
cp ../lavavu/html/LavaVu-amalgamated.js .
cp ../lavavu/html/LavaVu-amalgamated.css .
git stage *
git commit -m "Update LavaVu emscripten release"
git tag ${{ steps.get_version.outputs.VERSION }}
git push origin --tags