-
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.
Refactor GitHub Actions workflows for build and release
- Deleted `actions.yml` to separate build and release workflows for better clarity and maintainability. - Introduced `build-common.yml` to define common setup steps for node, Rust, and dependencies across platforms. - Added `build.yml` for handling build processes across different platforms with matrix strategy. - Created `release.yml` specifically for release tasks, ensuring builds are conducted and releases are drafted on designated branches. - These changes enhance modularity and reusability of the workflow configurations.
- Loading branch information
1 parent
5b47337
commit c702af5
Showing
4 changed files
with
114 additions
and
88 deletions.
There are no files selected for viewing
This file was deleted.
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Common Build Steps | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
platform: | ||
required: true | ||
type: string | ||
args: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
common-steps: | ||
runs-on: ${{ inputs.platform }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
|
||
- name: install Rust stable | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
targets: ${{ inputs.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} | ||
|
||
- name: install dependencies (ubuntu only) | ||
if: inputs.platform == 'ubuntu-22.04' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | ||
- name: install frontend dependencies | ||
run: npm install |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- 'release' | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.platform }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- platform: 'macos-latest' | ||
args: '--target aarch64-apple-darwin' | ||
- platform: 'macos-latest' | ||
args: '--target x86_64-apple-darwin' | ||
- platform: 'ubuntu-22.04' | ||
args: '' | ||
- platform: 'windows-latest' | ||
args: '' | ||
|
||
steps: | ||
- name: Call Common Build Steps | ||
uses: ./.github/workflows/build-common.yml | ||
with: | ||
platform: ${{ matrix.platform }} | ||
args: ${{ matrix.args }} | ||
|
||
- name: Build Tauri App | ||
uses: tauri-apps/tauri-action@v0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
args: ${{ matrix.args }} |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'release' | ||
|
||
jobs: | ||
release: | ||
runs-on: ${{ matrix.platform }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- platform: 'macos-latest' | ||
args: '--target aarch64-apple-darwin' | ||
- platform: 'macos-latest' | ||
args: '--target x86_64-apple-darwin' | ||
- platform: 'ubuntu-22.04' | ||
args: '' | ||
- platform: 'windows-latest' | ||
args: '' | ||
|
||
steps: | ||
- name: Call Common Build Steps | ||
uses: ./.github/workflows/build-common.yml | ||
with: | ||
platform: ${{ matrix.platform }} | ||
args: ${{ matrix.args }} | ||
|
||
- name: Create GitHub Release | ||
uses: tauri-apps/tauri-action@v0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tagName: app-v__VERSION__ | ||
releaseName: 'App v__VERSION__' | ||
releaseBody: 'See the assets to download this version and install.' | ||
releaseDraft: true | ||
prerelease: false | ||
args: '' |