Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: environment variable substitution for the Tauri build #360

Merged
merged 1 commit into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/actions/build-linux/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ runs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
sudo apt-get install -y libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev
shell: bash

- name: Bump version in tauri.conf.json
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ jobs:
release-tag: ${{ steps.create-release-action.outputs.release-tag }}
release-id: ${{ steps.create-release-action.outputs.release-id }}

# TODO: VITE_ tokens need to be replaced after building, but before bundling the Tauri app
build-tauri:
name: Build Tauri app
needs:
Expand All @@ -84,7 +83,7 @@ jobs:
strategy:
matrix:
# macos-14 is the Apple Silicon M1 runner
platform: [ubuntu-20.04, windows-latest, 'macos-12', 'macos-14']
platform: [ubuntu-22.04, windows-latest, 'macos-12', 'macos-14']
PatrickDinh marked this conversation as resolved.
Show resolved Hide resolved
if: ${{ needs.create-release.outputs.release-published == 'true' }}

steps:
Expand All @@ -103,6 +102,22 @@ jobs:
- name: Install npm dependencies
run: npm install

- name: Create .env file
run: |
sed -E -n 's/(VITE_[A-Z0-9_]+)=(.*)/\1="{{\1}}"/p' .env.sample > .env

- name: Substitute environment variables
uses: bluwy/substitute-string-action@v3
with:
_input-file: '.env'
_format-key: '{{key}}'
_output-file: '.env'
VITE_DISPENSER_AUTH0_DOMAIN: dispenser-prod.eu.auth0.com
VITE_DISPENSER_AUTH0_CLIENT_ID: Cg13HjvSV45pMme4dnK9yVJde8tVeDaM
VITE_DISPENSER_AUTH0_AUDIENCE: api-prod-dispenser-user
VITE_TESTNET_DISPENSER_API_URL: https://api.dispenser.algorandfoundation.tools
VITE_TESTNET_DISPENSER_ADDRESS: Z5GPJQCHVU54C2I4FLYNE2XHRQRL5OV2GPJQKXJFMW34CRIN2KRQFXF7DI

- name: Build for Linux
id: build-linux
if: ${{ runner.os == 'Linux' }}
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"@vitejs/plugin-react-swc": "^3.7.1",
"autoprefixer": "^10.4.18",
"better-npm-audit": "^3.7.3",
"conventional-changelog-conventionalcommits": "^7.0.2",
"conventional-changelog-conventionalcommits": "^8.0.0",
"cpy-cli": "^5.0.0",
"eslint": "^9.15.0",
"eslint-config-prettier": "^9.1.0",
Expand Down Expand Up @@ -197,4 +197,4 @@
"ws@>7.0.0 <7.5.9": "7.5.10",
"path-to-regexp@>= 0.2.0 <8.0.0": "8.0.0"
}
}
}
Loading