-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from lorforlinux/main
Add Arduino Nano support and setup GitHub actions
- Loading branch information
Showing
7 changed files
with
209 additions
and
18 deletions.
There are no files selected for viewing
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,177 @@ | ||
name: Build and Release Tauri App | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
check-version-and-tag: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get Version from package.json | ||
id: get_version | ||
run: | | ||
version="v$(jq -r '.version' package.json)" | ||
echo "::set-output name=version::$version" | ||
- name: Check if Tag Exists | ||
id: check_tag | ||
run: | | ||
version="${{ steps.get_version.outputs.version }}" | ||
if git rev-parse "$version" >/dev/null 2>&1; then | ||
echo "Tag $version already exists." | ||
echo "::set-output name=tag_exists::true" | ||
else | ||
echo "Tag $version does not exist." | ||
echo "::set-output name=tag_exists::false" | ||
fi | ||
- name: Create Tag | ||
if: steps.check_tag.outputs.tag_exists == 'false' | ||
run: | | ||
version="${{ steps.get_version.outputs.version }}" | ||
git config user.name "github-actions" | ||
git config user.email "[email protected]" | ||
git tag -a "$version" -m "Release version $version" | ||
git push origin "$version" | ||
build: | ||
needs: check-version-and-tag | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [macos-latest, windows-latest, ubuntu-22.04] | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Debug the runner OS | ||
run: echo "Running on ${{ runner.os }}" | ||
|
||
- name: Setup Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
npm install | ||
npm install tailwindcss-animate | ||
- name: Run npm audit | ||
run: npm audit --audit-level=high | ||
|
||
- name: Install GTK and Build Tools (Ubuntu only) | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libudev-dev build-essential pkg-config | ||
- name: Install Tauri CLI (locally) | ||
run: npm install @tauri-apps/cli | ||
|
||
- name: Clean npm cache | ||
run: npm cache clean --force | ||
|
||
- name: Build Tauri App | ||
run: npx tauri build | ||
|
||
# Upload platform-specific artifacts | ||
- name: Upload Artifact for macOS | ||
if: runner.os == 'macOS' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: tauri-app-macos | ||
path: src-tauri/target/release/bundle/dmg/*.dmg | ||
|
||
- name: Upload Artifact for Windows | ||
if: runner.os == 'Windows' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: tauri-app-windows | ||
path: src-tauri/target/release/bundle/msi/*.msi | ||
|
||
- name: Upload Artifact for Linux (deb) | ||
if: runner.os == 'Linux' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: tauri-app-linux-deb | ||
path: src-tauri/target/release/bundle/deb/*.deb | ||
|
||
- name: Upload Artifact for Linux (rpm) | ||
if: runner.os == 'Linux' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: tauri-app-linux-rpm | ||
path: src-tauri/target/release/bundle/rpm | ||
|
||
release: | ||
needs: [build, check-version-and-tag] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Fetch All Tags | ||
run: git fetch --tags | ||
|
||
- name: Verify Created Tag | ||
id: verified_version | ||
run: | | ||
version="v$(jq -r '.version' package.json)" | ||
echo "::set-output name=version::$version" | ||
echo "Verifying tag $version" | ||
if ! git tag -l | grep -q "$version"; then | ||
echo "Error: Tag $version not found locally." | ||
exit 1 | ||
fi | ||
# Download platform-specific artifacts | ||
- name: Download macOS Artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: tauri-app-macos | ||
path: src-tauri/target/release/bundle/dmg | ||
|
||
- name: Download Windows Artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: tauri-app-windows | ||
path: src-tauri/target/release/bundle/msi | ||
|
||
- name: Download Linux Artifact (deb) | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: tauri-app-linux-deb | ||
path: src-tauri/target/release/bundle/deb | ||
|
||
- name: Download Linux Artifact (rpm) | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: tauri-app-linux-rpm | ||
path: src-tauri/target/release/bundle/rpm | ||
|
||
# Create GitHub Release with only artifacts | ||
- name: Create Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: "${{ steps.verified_version.outputs.version }}" | ||
files: | | ||
src-tauri/target/release/bundle/dmg/*.dmg | ||
src-tauri/target/release/bundle/msi/*.msi | ||
src-tauri/target/release/bundle/deb/*.deb | ||
src-tauri/target/release/bundle/rpm/*.rpm | ||
draft: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
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
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