diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7974dd59..babb8e3c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -181,6 +181,9 @@ jobs: cd ../../ cp src/wasm-lib/pkg/wasm_lib_bg.wasm public + - name: Run vite build (build:both) + run: yarn vite build --mode ${{ env.BUILD_RELEASE == 'true' && 'production' || 'development' }} + - name: Fix format run: yarn fmt @@ -250,10 +253,12 @@ jobs: if: matrix.os == 'ubuntu-latest' run: | cargo install tauri-driver + source .env.${{ env.BUILD_RELEASE == 'true' && 'production' || 'development' }} + export VITE_KC_API_BASE_URL xvfb-run yarn test:e2e:tauri env: E2E_APPLICATION: "./src-tauri/target/${{ env.BUILD_RELEASE == 'true' && 'release' || 'debug' }}/kittycad-modeling" - KITTYCAD_API_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN }} + KITTYCAD_API_TOKEN: ${{ env.BUILD_RELEASE == 'true' && secrets.KITTYCAD_API_TOKEN || secrets.KITTYCAD_API_TOKEN_DEV }} publish-apps-release: diff --git a/e2e/tauri/specs/auth.e2e.ts b/e2e/tauri/specs/auth.e2e.ts index 1134f1eeb..3aee244f9 100644 --- a/e2e/tauri/specs/auth.e2e.ts +++ b/e2e/tauri/specs/auth.e2e.ts @@ -29,13 +29,14 @@ describe('KCMA (Tauri, Linux)', () => { Accept: 'application/json', 'Content-Type': 'application/json', } - const verifyUrl = `https://api.kittycad.io/oauth2/device/verify?user_code=${userCode}` + const apiBaseUrl = process.env.VITE_KC_API_BASE_URL + const verifyUrl = `${apiBaseUrl}/oauth2/device/verify?user_code=${userCode}` console.log(`GET ${verifyUrl}`) const vr = await fetch(verifyUrl, { headers }) console.log(vr.status) // Device flow: confirm - const confirmUrl = 'https://api.kittycad.io/oauth2/device/confirm' + const confirmUrl = `${apiBaseUrl}/oauth2/device/confirm` const data = JSON.stringify({ user_code: userCode }) console.log(`POST ${confirmUrl} ${data}`) const cr = await fetch(confirmUrl, { diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 8c244e68f..cb6306511 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,6 @@ { "$schema": "../node_modules/@tauri-apps/cli/schema.json", "build": { - "beforeBuildCommand": "yarn build:both", "beforeDevCommand": "yarn start", "devPath": "http://localhost:3000", "distDir": "../build"