Skip to content

Windows builds in CI #369

Windows builds in CI

Windows builds in CI #369

Workflow file for this run

name: Tauri Release
on:
workflow_dispatch:
pull_request:
paths:
- ".github/workflows/tauri-release.yml"
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-and-sign-tauri:
strategy:
fail-fast: false
matrix:
target:
[x86_64-pc-windows-msvc]
include:
- target: x86_64-pc-windows-msvc
name: windows-2019
runs-on: ${{ matrix.name }}
env:
ORT_LIB_LOCATION: ${{ github.workspace }}/lib/${{ matrix.target }}/onnxruntime
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create LFS file list
run: git lfs ls-files --long | cut -d ' ' -f1 | sort > .lfs-assets-id
- name: LFS Cache
uses: actions/cache@v3
with:
path: .git/lfs/objects
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}
restore-keys: |
${{ runner.os }}-lfs-
- name: Git LFS Pull
run: git lfs install && git lfs pull
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: "npm"
- name: Install app dependencies
run: npm ci
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.73.0
target: ${{ matrix.target }}
- name: Check if keys exist
env:
analytics_key: ${{ secrets.ANALYTICS_BE_WRITE_KEY_PROD }}
analytics_fe_key: ${{ secrets.ANALYTICS_FE_WRITE_KEY_PROD }}
sentry_dsn: ${{ secrets.SENTRY_DSN_BE }}
sentry_dsn_fe: ${{ secrets.SENTRY_DSN_FE }}
if: ${{ env.analytics_fe_key == '' || env.sentry_dsn_fe == '' || env.analytics_key == '' || env.sentry_dsn == ''}}
run: exit 1
- name: Set environment
run: echo "{""analytics_key"":""${{ secrets.ANALYTICS_BE_WRITE_KEY_PROD }}"",""analytics_data_plane"":""${{ secrets.ANALYTICS_DATA_PLANE_URL }}"",""sentry_dsn_fe"":""${{ secrets.SENTRY_DSN_FE }}"",""sentry_dsn"":""${{ secrets.SENTRY_DSN_BE }}"",""analytics_key_fe"":""${{ secrets.ANALYTICS_FE_WRITE_KEY_PROD }}"",""answer_api_url"":""${{ secrets.ANSWER_API_URL }}"",""cognito_userpool_id"":""${{ secrets.COGNITO_USERPOOL_ID }}"",""cognito_client_id"":""${{ secrets.COGNITO_CLIENT_ID }}"",""cognito_auth_url"":""${{ secrets.COGNITO_AUTH_URL }}"",""cognito_mgmt_url"":""${{ secrets.COGNITO_MGMT_URL }}"",""cognito_config_url"":""${{ secrets.COGNITO_CONFIG_URL }}""}" > apps/desktop/src-tauri/config/config.json
- name: Check environment is set
run: du -h apps/desktop/src-tauri/config/config.json
- name: Set identifier to bloop on Windows, in tauri.conf.json
if: matrix.target == 'x86_64-pc-windows-msvc'
uses: jossef/action-set-json-field@v2.1
with:
file: apps/desktop/src-tauri/tauri.conf.json
field: tauri.bundle.identifier
value: bloop
- uses: tauri-apps/tauri-action@cb58ba3f65bd456ee564376585a8400bf0b71f47
env:
NODE_OPTIONS: "--max-old-space-size=4096"
ORT_LIB_LOCATION: ${{ github.workspace }}/lib/${{ matrix.target }}/onnxruntime
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_CODE_SIGNING: false
TAURI_BIN_PATH: apps/desktop/src-tauri/bin
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
args: -- --target "${{ matrix.target }}" -v
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}-app
path: target/${{ matrix.target }}/release/bundle
retention-days: 5
- name: List files
run: ls -R target/${{ matrix.target }}/release/bundle