Add rustc #295
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: npm build | |
on: [push] | |
jobs: | |
read_fe_tag: | |
runs-on: ubuntu-latest | |
outputs: | |
fe_tag: ${{ steps.fe_tag_step.outputs.fe_tag }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get CamillaGUI tag from versions.yml | |
id: fe_tag_step | |
run: | | |
FE_TAG=$(sed -n 's/camillagui_tag: \(.*\)$/\1/p' release_automation/versions.yml) | |
echo "fe_tag=$FE_TAG" | |
echo "fe_tag=$FE_TAG" >> "$GITHUB_OUTPUT" | |
build_fe: | |
runs-on: ubuntu-latest | |
needs: read_fe_tag | |
steps: | |
- uses: actions/checkout@v4 | |
name: Check out frontend ${{ needs.read_fe_tag.outputs.fe_tag }} | |
with: | |
repository: HEnquist/camillagui | |
ref: ${{ needs.read_fe_tag.outputs.fe_tag }} | |
- name: Build and publish | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- run: npm install | |
- run: npm run build | |
- name: Upload build | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build | |
path: build | |
build_and_test_be: | |
runs-on: ubuntu-latest | |
needs: build_fe | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install template render dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install jinja2 PyYAML | |
- name: Render scripts from templates | |
run: python -Bm release_automation.render_env_files | |
- name: Install requirements | |
run: python -m pip install -r requirements.txt | |
- name: Set up pytest | |
run: python -m pip install pytest-aiohttp | |
- name: Run python tests | |
run: python -Bm pytest | |
- name: Clean up | |
run: | | |
rm -rf release_automation | |
rm -rf tests | |
- name: Download frontend | |
uses: actions/download-artifact@v4 | |
- name: Create zip | |
run: zip -r camillagui.zip * | |
- name: Upload all as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: camillagui-backend | |
path: | | |
. | |
!.git* | |
- name: Upload binaries to release | |
if: contains(github.ref, 'refs/tags/') | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: camillagui.zip | |
asset_name: camillagui.zip | |
tag: ${{ github.ref }} | |
pyinstaller_win: | |
runs-on: windows-latest | |
needs: build_and_test_be | |
steps: | |
- name: Download complete distribution | |
uses: actions/download-artifact@v4 | |
with: | |
name: camillagui-backend | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- run: pip install -r requirements.txt | |
- run: pip install pyinstaller | |
- run: pyinstaller .\main.py --add-data .\config\:config --add-data .\build\:build --collect-data camilladsp_plot --name camillagui_backend | |
- name: Upload build | |
uses: actions/upload-artifact@v4 | |
with: | |
name: standalone_win | |
path: dist | |
pyinstaller_linux: | |
runs-on: ubuntu-22.04 | |
needs: build_and_test_be | |
name: Build pyinstaller package on ${{ matrix.arch }} | |
strategy: | |
matrix: | |
include: | |
- arch: aarch64 | |
- arch: armv7 | |
- arch: armv6 | |
steps: | |
- name: Download complete distribution | |
uses: actions/download-artifact@v4 | |
with: | |
name: camillagui-backend | |
- uses: uraimo/run-on-arch-action@v2 | |
name: Build artifact | |
id: build | |
with: | |
arch: ${{ matrix.arch }} | |
distro: bookworm | |
# Mount the artifacts directory as /artifacts in the container | |
dockerRunArgs: | | |
--volume "${PWD}:/cdsp" | |
install: | | |
apt update -y | |
apt install git python3 python3-pip python3-venv rustc cargo -y | |
run: | | |
python3 -m venv ./venv | |
./venv/bin/python3 -m pip install -r requirements.txt | |
./venv/bin/python3 -m pip install pyinstaller | |
cd cdsp | |
../venv/bin/python3 -m PyInstaller ./main.py --add-data ./config/:config --add-data ./build/:build --collect-data camilladsp_plot --name camillagui_backend | |
- name: Upload build | |
uses: actions/upload-artifact@v4 | |
with: | |
name: standalone_linux_${{ matrix.arch }} | |
path: dist |