-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
212 additions
and
25 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,9 @@ jobs: | |
args: '' | ||
|
||
runs-on: ${{ matrix.settings.platform }} | ||
env: | ||
DB_USER: ${{ secrets.DB_USER }} | ||
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
|
@@ -71,6 +74,32 @@ jobs: | |
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too. | ||
run: pnpm install # change this to npm or pnpm depending on which one you use. | ||
|
||
- name: replace .env file (macos and linux only) | ||
if: matrix.settings.platform != 'windows-latest' | ||
run: | | ||
if [[ -n "${{ secrets.DB_USER }}" ]] && [[ -n "${{ secrets.DB_PASSWORD }}" ]]; then | ||
sed -i 's/DATABASE_URL=mysql:\/\/root:@127.0.0.1:3306\/libraryroom/DATABASE_URL=mysql:\/\/${{ secrets.DB_USER }}:${{ secrets.DB_PASSWORD }}@127.0.0.1:3306\/libraryroom/g' "src-tauri/.env" | ||
elif [[ -n "${{ secrets.DB_USER }}" ]]; then | ||
sed -i 's/DATABASE_URL=mysql:\/\/root:@127.0.0.1:3306\/libraryroom/DATABASE_URL=mysql:\/\/${{ secrets.DB_USER }}:@127.0.0.1:3306\/libraryroom/g' "src-tauri/.env" | ||
elif [[ -n "${{ secrets.DB_PASSWORD }}" ]]; then | ||
sed -i 's/DATABASE_URL=mysql:\/\/root:@127.0.0.1:3306\/libraryroom/DATABASE_URL=mysql:\/\/root:${{ secrets.DB_PASSWORD }}@127.0.0.1:3306\/libraryroom/g' "src-tauri/.env" | ||
fi | ||
- name: replace .env file (windows only) | ||
if: matrix.settings.platform == 'windows-latest' | ||
run: | | ||
$envContent = Get-Content src-tauri/.env | ||
if ($env:DB_USER) { | ||
if ($env:DB_PASSWORD) { | ||
$envContent = $envContent -replace 'DATABASE_URL=mysql://root:@127.0.0.1:3306/libraryroom', "DATABASE_URL=mysql://$env:DB_USER:$env:[email protected]:3306/libraryroom" | ||
} else { | ||
$envContent = $envContent -replace 'DATABASE_URL=mysql://root:@127.0.0.1:3306/libraryroom', "DATABASE_URL=mysql://$env:DB_USER:@127.0.0.1:3306/libraryroom" | ||
} | ||
} elseif ($env:DB_PASSWORD) { | ||
$envContent = $envContent -replace 'DATABASE_URL=mysql://root:@127.0.0.1:3306/libraryroom', "DATABASE_URL=mysql://root:$env:[email protected]:3306/libraryroom" | ||
} | ||
$envContent | Set-Content src-tauri/.env | ||
- uses: tauri-apps/tauri-action@v0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "LibraryRoomBookingSystem" | ||
version = "1.0.5" | ||
version = "1.0.6" | ||
description = "A Library Room Booking System built with Tauri and Rust" | ||
authors = ["Lim Shi Song [email protected]"] | ||
edition = "2021" | ||
|
@@ -9,6 +9,7 @@ edition = "2021" | |
|
||
[build-dependencies] | ||
tauri-build = { version = "1", features = [] } | ||
dotenvy = "0.15.7" | ||
|
||
[dependencies] | ||
tauri = { version = "1", features = ["shell-open"] } | ||
|
@@ -17,6 +18,7 @@ jsonwebtoken = "9" | |
serde_json = "1" | ||
dotenvy = "0.15.7" | ||
chrono = "0.4.38" | ||
envcrypt = "0.5.0" | ||
|
||
[dependencies.tauri-plugin-sql] | ||
git = "https://github.com/tauri-apps/plugins-workspace" | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
fn main() { | ||
tauri_build::build() | ||
println!("cargo:rerun-if-changed=.env"); | ||
|
||
for item in dotenvy::dotenv_iter().unwrap() { | ||
let (key, value) = item.unwrap(); | ||
println!("cargo:rustc-env={key}={value}"); | ||
} | ||
tauri_build::build(); | ||
} |
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
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
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
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
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
Oops, something went wrong.