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

Universal build for MacOS and fix windows build #313

Merged
merged 4 commits into from
Jul 25, 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
97 changes: 17 additions & 80 deletions .github/workflows/tauri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ jobs:
node-version: 20.12.2
cache: 'npm'
- name: Install Rust stable
uses: actions-rs/[email protected]
with:
toolchain: stable
uses: dtolnay/rust-toolchain@stable
- name: Install cinny dependencies
run: cd cinny && npm ci
- name: Install tauri dependencies
Expand Down Expand Up @@ -60,9 +58,9 @@ jobs:
uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0
with:
files: |
src-tauri\target\release\bundle\msi\Cinny_desktop-x86_64.msi
src-tauri\target\release\bundle\msi\Cinny_desktop-x86_64.msi.zip
src-tauri\target\release\bundle\msi\Cinny_desktop-x86_64.msi.zip.sig
src-tauri/target/release/bundle/msi/Cinny_desktop-x86_64.msi
src-tauri/target/release/bundle/msi/Cinny_desktop-x86_64.msi.zip
src-tauri/target/release/bundle/msi/Cinny_desktop-x86_64.msi.zip.sig

# Linux-x86_64
linux-x86_64:
Expand All @@ -84,9 +82,7 @@ jobs:
node-version: 20.12.2
cache: 'npm'
- name: Install Rust stable
uses: actions-rs/[email protected]
with:
toolchain: stable
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: |
sudo apt-get update
Expand Down Expand Up @@ -124,8 +120,8 @@ jobs:
src-tauri/target/release/bundle/appimage/Cinny_desktop-x86_64.AppImage.tar.gz
src-tauri/target/release/bundle/appimage/Cinny_desktop-x86_64.AppImage.tar.gz.sig

# macos-x86_64
macos-x86_64:
# macos-universal
macos-universal:
runs-on: macos-latest
steps:
- name: Checkout repository
Expand All @@ -143,9 +139,9 @@ jobs:
node-version: 20.12.2
cache: 'npm'
- name: Install Rust stable
uses: actions-rs/toolchain@v1.0.7
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: aarch64-apple-darwin,x86_64-apple-darwin
- name: Install cinny dependencies
run: cd cinny && npm ci
- name: Install tauri dependencies
Expand All @@ -159,87 +155,28 @@ jobs:
NODE_OPTIONS: "--max_old_space_size=4096"
with:
releaseId: ${{ steps.get_release.outputs.upload_url }}
args: "--target universal-apple-darwin"
- name: Get app version
id: vars
run: echo ::set-output name=tag::$(jq .package.version src-tauri/tauri.conf.json | tr -d '"')
- name: Move dmg
run: mv "src-tauri/target/release/bundle/dmg/Cinny_${{ steps.vars.outputs.tag }}_aarch64.dmg" "src-tauri/target/release/bundle/dmg/Cinny_desktop-x86_64.dmg"
run: mv "src-tauri/target/universal-apple-darwin/release/bundle/dmg/Cinny_${{ steps.vars.outputs.tag }}_universal.dmg" "src-tauri/target/universal-apple-darwin/release/bundle/dmg/Cinny_desktop-universal.dmg"
- name: Move app.tar.gz
run: mv "src-tauri/target/release/bundle/macos/Cinny.app.tar.gz" "src-tauri/target/release/bundle/macos/Cinny_desktop-x86_64.app.tar.gz"
run: mv "src-tauri/target/universal-apple-darwin/release/bundle/macos/Cinny.app.tar.gz" "src-tauri/target/universal-apple-darwin/release/bundle/macos/Cinny_desktop-universal.app.tar.gz"
- name: Move app.tar.gz.sig
run: mv "src-tauri/target/release/bundle/macos/Cinny.app.tar.gz.sig" "src-tauri/target/release/bundle/macos/Cinny_desktop-x86_64.app.tar.gz.sig"
run: mv "src-tauri/target/universal-apple-darwin/release/bundle/macos/Cinny.app.tar.gz.sig" "src-tauri/target/universal-apple-darwin/release/bundle/macos/Cinny_desktop-universal.app.tar.gz.sig"
- name: Upload tagged release
uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0
with:
files: |
src-tauri/target/release/bundle/dmg/Cinny_desktop-x86_64.dmg
src-tauri/target/release/bundle/macos/Cinny_desktop-x86_64.app.tar.gz
src-tauri/target/release/bundle/macos/Cinny_desktop-x86_64.app.tar.gz.sig

# macos-aarch64
# macos-aarch64:
# runs-on: macos-12
# steps:
# - name: Checkout repository
# uses: actions/[email protected]
# with:
# submodules: true
# - name: Get release
# id: get_release
# uses: bruceadams/get-release@74c3d60f5a28f358ccf241a00c9021ea16f0569f
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Setup node
# uses: actions/[email protected]
# with:
# node-version: 20.12.2
# cache: 'npm'
# - name: Install Rust stable
# uses: actions-rs/[email protected]
# with:
# toolchain: stable
# - name: Install cinny dependencies
# run: cd cinny && npm ci
# - name: Install tauri dependencies
# run: npm ci
# - name: Install rustup target aarch64 darwin
# run: rustup target add aarch64-apple-darwin
# - name: Build desktop app with Tauri
# uses: tauri-apps/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
# TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
# NODE_OPTIONS: "--max_old_space_size=4096"
# with:
# args: --target aarch64-apple-darwin
# releaseId: ${{ steps.get_release.outputs.upload_url }}
# - name: Get app version
# if: always()
# id: vars
# run: echo ::set-output name=tag::$(jq .package.version src-tauri/tauri.conf.json | tr -d '"')
# - name: Move dmg
# if: always()
# run: mv "src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/Cinny_${{ steps.vars.outputs.tag }}_aarch64.dmg" "src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/Cinny_desktop-aarch64.dmg"
# - name: Move app.tar.gz
# if: always()
# run: mv "src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Cinny.app.tar.gz" "src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Cinny_desktop-aarch64.app.tar.gz"
# - name: Move app.tar.gz.sig
# if: always()
# run: mv "src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Cinny.app.tar.gz.sig" "src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Cinny_desktop-aarch64.app.tar.gz.sig"
# - name: Upload tagged release
# if: always()
# uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0
# with:
# files: |
# src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/Cinny_desktop-aarch64.dmg
# src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Cinny_desktop-aarch64.tar.gz
# src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Cinny_desktop-aarch64.tar.gz.sig
src-tauri/target/universal-apple-darwin/release/bundle/dmg/Cinny_desktop-universal.dmg
src-tauri/target/universal-apple-darwin/release/bundle/macos/Cinny_desktop-universal.app.tar.gz
src-tauri/target/universal-apple-darwin/release/bundle/macos/Cinny_desktop-universal.app.tar.gz.sig

# Upload release.json
release-update:
if: always()
needs: [windows-x86_64, linux-x86_64, macos-x86_64] #, macos-aarch64]
needs: [windows-x86_64, linux-x86_64, macos-universal]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
22 changes: 11 additions & 11 deletions scripts/release.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async function createTauriRelease() {
const windowsX86_64 = {};
const linuxX86_64 = {};
const darwinX86_64 = {};
// const darwinAarch64 = {};
const darwinAarch64 = {};

const promises = latestAssets.map(async (asset) => {
const { name, browser_download_url } = asset;
Expand All @@ -53,19 +53,19 @@ async function createTauriRelease() {
linuxX86_64.signature = await getAssetSign(browser_download_url);
}

if (/x86_64\.app\.tar\.gz$/.test(name)) {
if (/universal\.app\.tar\.gz$/.test(name)) {
darwinX86_64.url = browser_download_url;
}
if (/x86_64\.app\.tar\.gz\.sig$/.test(name)) {
if (/universal\.app\.tar\.gz\.sig$/.test(name)) {
darwinX86_64.signature = await getAssetSign(browser_download_url);
}

// if (/aarch64\.app\.tar\.gz$/.test(name)) {
// darwinAarch64.url = browser_download_url;
// }
// if (/aarch64\.app\.tar\.gz\.sig$/.test(name)) {
// darwinAarch64.signature = await getAssetSign(browser_download_url);
// }
if (/universal\.app\.tar\.gz$/.test(name)) {
darwinAarch64.url = browser_download_url;
}
if (/universal\.app\.tar\.gz\.sig$/.test(name)) {
darwinAarch64.signature = await getAssetSign(browser_download_url);
}
});

await Promise.allSettled(promises);
Expand All @@ -86,8 +86,8 @@ async function createTauriRelease() {
if (darwinX86_64.url) releaseData.platforms["darwin-x86_64"] = darwinX86_64;
else console.error('Failed to get release for darwinX86_64');

// if (darwinAarch64.url) releaseData.platforms["darwin-aarch64"] = darwinAarch64;
// else console.error('Failed to get release for darwinAarch64');
if (darwinAarch64.url) releaseData.platforms["darwin-aarch64"] = darwinAarch64;
else console.error('Failed to get release for darwinAarch64');

const releaseResult = await repos.getReleaseByTag({ ...repoMetaData, tag: 'tauri' });
const tauriRelease = releaseResult.data;
Expand Down
Loading