Merge pull request #10 from EyeTrackVR/feature/serial-camera #49
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: App Builder | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "v*.*.*" | |
branches: | |
- main | |
- master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
defaults: | |
run: | |
shell: bash | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ env.GITHUB_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Setup Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: Load cached wheels | |
id: cached-pip-wheels | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
#---------------------------------------------- | |
# load cached venv if cache exists | |
#---------------------------------------------- | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install python dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install | |
- name: Install Linux dependencies | |
if: ${{ matrix.os == 'ubuntu-latest'}} | |
run: sudo apt install build-essential curl wget libssl-dev | |
- run: source $VENV | |
- name: Build Backend | |
run: poetry run pyinstaller --noconfirm ETVR.spec TrackingBackend/main.py | |
- name: Rename Linux Binary | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
#mv ./dist/ETVR ./dist/ETVR.bin | |
run: | | |
ls -a dist | |
mv ./dist/ETVR ./dist/ETVR.bin | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: production-files | |
path: dist | |
deploy: | |
runs-on: ubuntu-latest | |
name: Deploy | |
needs: [build] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Create Directory | |
run: mkdir -p dist | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: production-files | |
path: ./dist | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- run: npm install -g conventional-changelog-conventionalcommits@6 | |
- run: npm install -g [email protected] | |
- run: npm install -g @semantic-release/exec | |
- run: npm install -g @semantic-release/git | |
- run: npm install -g @semantic-release/release-notes-generator | |
- run: npm install -g @semantic-release/changelog | |
- run: npm install -g @semantic-release/github | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
chmod +x ./.github/scripts/prepareCMD.sh | |
semantic-release | |
cleanup: | |
name: Cleanup actions | |
needs: | |
- deploy | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: "♻️ remove build artifacts" | |
uses: geekyeggo/delete-artifact@v1 | |
with: | |
name: production-files |