Skip to content

Commit

Permalink
cross build compilation CI (#29)
Browse files Browse the repository at this point in the history
- releaseが作成されたらWindowsとMac用にインストーラーが自動作成され、releaseからダウンロードできる
- イメージ:https://github.com/MIERUNE/tauri-build-sample/releases
- また、ビルドするために、tauriのidentifierを変えています。
 ```
Error You must change the bundle identifier in `tauri.conf.json > tauri
> bundle > identifier`. The default Value `com.tauri.dev` is not allowed
as it must be unique across applications.
```

- github actionsを発火させるために、このようなテスト手順になります
 - mainブランチにマージ
 - releaseを発行
 - actionが正常終了したら、ファイルをローカルにダウンロード
 
  • Loading branch information
xinmiaooo authored Dec 4, 2023
1 parent 57e86bb commit a74c6b0
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/cross-platform-compilation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release
on:
release:
types: [published]

jobs:
release:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Rust setup
uses: dtolnay/rust-toolchain@stable

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'

- name: Sync node version and setup cache
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: ./app/package-lock.json

- name: Install frontend dependencies
run: npm install
working-directory: ./app

- name: Build the app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: ${{ github.event.release.tag_name }}
releaseName: "App v__VERSION__"
releaseDraft: true
prerelease: false

2 changes: 1 addition & 1 deletion app/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"icons/icon.icns",
"icons/icon.ico"
],
"identifier": "com.tauri.dev",
"identifier": "jp.co.mierune.nusamai",
"longDescription": "",
"macOS": {
"entitlements": null,
Expand Down

0 comments on commit a74c6b0

Please sign in to comment.