Skip to content

Commit

Permalink
feat: enable auto-updater
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeroen Nijhuis committed Apr 22, 2024
1 parent 1253225 commit 9375210
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches: ["main"]
types:
- completed

concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -27,8 +27,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
cache: "npm"

- name: Install dependencies
run: npm install

Expand All @@ -54,12 +54,15 @@ jobs:
- name: Build Vite + Tauri (MacOS + Linux)
if: matrix.platform != 'windows-latest'
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
run: |
npm run build
- name: Build Vite + Tauri (Windows)
if: matrix.platform == 'windows-latest'
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
OPENSSL_DIR: 'C:\Program Files\OpenSSL'
SSL_CERT_FILE: 'C:\Program Files\OpenSSL\ca\cacert.pem'
OPENSSL_NO_VENDOR: 1
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
cache: "npm"

- name: Install dependencies
run: npm install
Expand All @@ -51,6 +51,8 @@ jobs:
- name: Build Vite + Tauri (MacOS + Linux)
if: matrix.platform != 'windows-latest'
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
run: npm run build

- name: Build Vite + Tauri (Windows)
Expand All @@ -59,17 +61,19 @@ jobs:
OPENSSL_DIR: 'C:\Program Files\OpenSSL'
SSL_CERT_FILE: 'C:\Program Files\OpenSSL\ca\cacert.pem'
OPENSSL_NO_VENDOR: 1
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
run: npm run build

- name: Create release (MacOS + Linux)
if: matrix.platform != 'windows-latest'
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
with:
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: 'v__VERSION__'
releaseBody: 'See the assets to download and install this version.'
releaseName: "v__VERSION__"
releaseBody: "See the assets to download and install this version."
releaseDraft: true
prerelease: false
tauriScript: ./node_modules/.bin/tauri
Expand All @@ -82,10 +86,11 @@ jobs:
SSL_CERT_FILE: 'C:\Program Files\OpenSSL\ca\cacert.pem'
OPENSSL_NO_VENDOR: 1
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
with:
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: 'v__VERSION__'
releaseBody: 'See the assets to download and install this version.'
releaseName: "v__VERSION__"
releaseBody: "See the assets to download and install this version."
releaseDraft: true
prerelease: false
tauriScript: ./node_modules/.bin/tauri
19 changes: 16 additions & 3 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,25 @@
"beforeBuildCommand": "npm run vite:build"
},
"tauri": {
"updater": {
"active": true,
"endpoints": ["https://www.jet-pilot.app/latest.json"],
"dialog": true,
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDVDNUVCM0NBRDZFNzFFOEIKUldTTEh1Zld5ck5lWEx6MEdwZXp4cHBReDR6dUtac3pNUm9GbUxvcFhKS28wOTJQL1BqNkFiN2EK"
},
"macOSPrivateApi": true,
"allowlist": {
"all": true,
"fs": {
"all": true,
"scope": ["$APPCONFIG/", "$APPCONFIG/*", "$TEMP/", "$TEMP/*", "$TEMP/*/**", "$TEMP/**"]
"all": true,
"scope": [
"$APPCONFIG/",
"$APPCONFIG/*",
"$TEMP/",
"$TEMP/*",
"$TEMP/*/**",
"$TEMP/**"
]
},
"shell": {
"scope": [
Expand Down Expand Up @@ -55,4 +68,4 @@
"csp": null
}
}
}
}

0 comments on commit 9375210

Please sign in to comment.