Build offline Hedy #77
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 offline Hedy | |
on: | |
# Can be run on-demand | |
workflow_dispatch: {} | |
# Runs when 'deploy to prod' runs | |
workflow_run: | |
workflows: ["Deploy to hedy.org"] | |
types: [requested] | |
branches: | |
- 'main' | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
cache: 'pip' | |
- name: Set up NodeJS 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
- name: 'Install npx' | |
run: npm install -g npx | |
- run: pip install -r requirements.txt | |
name: 'Python requirements' | |
- run: doit run _offline | |
- name: Smoke test the build | |
run: cd dist && offlinehedy/run-hedy-server --smoketest | |
- uses: fregante/daily-version-action@v2 | |
name: Create tag if necessary | |
id: daily-version | |
- name: Create zip file | |
# Because we're on Windows | |
run: | | |
cd dist/offlinehedy && Compress-Archive -Path . -Destination ../../offlinehedy-${{ steps.daily-version.outputs.version }}.zip | |
- if: steps.daily-version.outputs.created | |
name: Create Release | |
uses: shogo82148/actions-create-release@v1 | |
id: create_release | |
with: | |
tag_name: ${{ steps.daily-version.outputs.version }} | |
generate_release_notes: true | |
- name: Upload Assets | |
if: steps.daily-version.outputs.created | |
uses: shogo82148/actions-upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: '*.zip' |