Skip to content

Commit

Permalink
Deploy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderson1993 committed Jan 30, 2025
1 parent 44ff2de commit fabf448
Show file tree
Hide file tree
Showing 29 changed files with 116 additions and 1,147 deletions.
106 changes: 84 additions & 22 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# TODO:
# - Re-enable app signing once Bun supports it https://github.com/oven-sh/bun/issues/7208
# - Upload Bun servers to the Github release for headless use
# - Add Windows and Ubuntu signing someday

name: Build/release
on:
push:
Expand All @@ -23,7 +28,6 @@ jobs:
name: build
path: build
release:
runs-on: ${{ matrix.os }}
needs: build
permissions:
contents: write
Expand All @@ -37,24 +41,23 @@ jobs:
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
arch: 'x86_64-apple-darwin'
- platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04.
- platform: 'ubuntu-24.04' # for Tauri v1 you could replace this with ubuntu-20.04.
args: ''
arch: 'x86_64-unknown-linux-gnu'
- platform: 'windows-latest'
args: ''
arch: 'x86_64-pc-windows-msvc'
runs-on: ${{ matrix.platform }}
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
ref: ${{env.GITHUB_REF}}
ref: alpha
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
if: matrix.platform == 'ubuntu-24.04' # This must match the platform value defined above.
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
# You can remove the one that doesn't apply to your app to speed up the workflow a bit.
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
Expand All @@ -75,37 +78,96 @@ jobs:
name: build
path: build
- name: Build Bun Server
run: BUILD_ARCH=${{ matrix.settings.arch}} bun run build:server
run: bun run build:server
env:
BUILD_ARCH: ${{ matrix.settings.arch }}
- name: Prepare for app notarization
if: startsWith(matrix.os, 'macos')
if: startsWith(matrix.platform, 'macos')
# Import Apple API key for app notarization on macOS
run: |
mkdir -p ~/private_keys/
echo '${{ secrets.api_key }}' > ~/private_keys/AuthKey_${{ secrets.api_key_id }}.p8
- name: Import Apple Developer Certificate
if: startsWith(matrix.platform, 'macos')
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
echo $APPLE_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain
security find-identity -v -p codesigning build.keychain
- name: Verify Certificate
if: startsWith(matrix.platform, 'macos')
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
run: |
CERT_INFO=$(security find-identity -v -p codesigning build.keychain | grep "Apple Development")
CERT_ID=$(echo "$CERT_INFO" | awk -F'"' '{print $2}')
echo "CERT_ID=$CERT_ID" >> $GITHUB_ENV
echo "Certificate imported."
- name: Get Tauri Version
if: startsWith(matrix.platform, 'windows')
id: get-version
shell: node {0}
run: |
const fs = require('fs');
const path = require('path');
try {
const configPath = path.join(process.cwd(), 'src-tauri', 'tauri.conf.json');
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
const version = config.version.replace('alpha.', '');
// Write to GITHUB_OUTPUT environment file
const outputFile = process.env.GITHUB_OUTPUT;
fs.appendFileSync(outputFile, `version=${version}\n`);
} catch (error) {
console.error('Error processing version:', error);
process.exit(1);
}
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Signing
APPLE_CERTIFICATE: ${{ secrets.MAC_CERTS }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.MAC_CERTS_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
# Disabling code signing until this issue is resolved https://github.com/oven-sh/bun/issues/7208
# # Signing
# APPLE_CERTIFICATE: ${{ secrets.MAC_CERTS }}
# APPLE_CERTIFICATE_PASSWORD: ${{ secrets.MAC_CERTS_PASSWORD }}
# APPLE_SIGNING_IDENTITY: ${{ env.CERT_ID }}

# Notarization
APPLE_API_ISSUER: ${{ secrets.API_KEY_ISSUER_ID }}
APPLE_API_KEY: ${{ secrets.api_key_id }}
APPLE_API_KEY_PATH: ~/private_keys/AuthKey_${{ secrets.api_key_id }}.p8
# # Notarization
# APPLE_API_ISSUER: ${{ secrets.API_KEY_ISSUER_ID }}
# APPLE_API_KEY: ${{ secrets.api_key_id }}
# APPLE_API_KEY_PATH: ~/private_keys/AuthKey_${{ secrets.api_key_id }}.p8

APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
# APPLE_ID: ${{ secrets.APPLE_ID }}
# APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
# APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
with:
appVersion: ${{ steps.get-version.outputs.version }}
tagName: __VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: '__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
args: ${{ matrix.settings.args }}
- name: Setup tmate session
uses: mxschmitt/action-tmate@v2
if: failure()
- uses: little-core-labs/[email protected]
id: tagName
- name: Upload headless
run: |
gh release upload ${{ steps.tagName.outputs.tag }} src-tauri/binaries/*
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v2
# if: failure()
8 changes: 7 additions & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@
[
"@semantic-release/exec",
{
"prepareCmd": "bunx tauri-version ${nextRelease.version} --no-git --no-lock",
"publishCmd": "bun run build:client"
}
],
[
"@semantic-release/git",
{
"assets": ["CHANGELOG.md", "package.json"],
"assets": [
"CHANGELOG.md",
"package.json",
"src-tauri/tauri.conf.json",
"src-tauri/Cargo.toml"
],
"message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"
}
]
Expand Down
3 changes: 3 additions & 0 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@
},
},
},
"patchedDependencies": {
"@thorium-sim/[email protected]": "patches/@thorium-sim%[email protected]",
},
"packages": {
"@alloc/quick-lru": ["@alloc/[email protected]", "", {}, "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw=="],

Expand Down
7 changes: 0 additions & 7 deletions desktop-old/electron-esbuild.config.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions desktop-old/esbuild.main.config.ts

This file was deleted.

103 changes: 0 additions & 103 deletions desktop-old/main/electron.ts

This file was deleted.

44 changes: 0 additions & 44 deletions desktop-old/main/helpers/autoUpdate.ts

This file was deleted.

37 changes: 0 additions & 37 deletions desktop-old/main/helpers/bonjour.ts

This file was deleted.

Loading

0 comments on commit fabf448

Please sign in to comment.