From b41963e112d3dd71eb88455fda25c67c0b26aabd Mon Sep 17 00:00:00 2001 From: Bill Maxwell Date: Thu, 15 Feb 2024 09:16:45 -0700 Subject: [PATCH] ci - add tauri builds Adds support for Tauri builds on main to verify it builds correctly. no artifact is published. Adds support for Tauri publishing on tagged releases. Signed-off-by: Bill Maxwell --- .github/workflows/main-release.yaml | 31 +++++++++++++++ .github/workflows/tag-release.yaml | 61 +++++++++++++++++++++++++++++ tauri/scripts/bundle-prep.sh | 4 ++ 3 files changed, 96 insertions(+) diff --git a/.github/workflows/main-release.yaml b/.github/workflows/main-release.yaml index e0528fd..5e4c4bf 100644 --- a/.github/workflows/main-release.yaml +++ b/.github/workflows/main-release.yaml @@ -40,3 +40,34 @@ jobs: ORG: ${{ github.repository_owner }} REPO: ${{ github.event.repository.name }} GITHUB_WORKFLOW: ${{ github.workflow }} + + build-tauri: + runs-on: [macos-latest] + permissions: + contents: write + steps: + - name: Checkout code + 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: Set up Nodejs + uses: actions/setup-node@v4 + with: + node-version: "lts/*" + + - name: Install frontend dependencies + run: cd tauri && npm install + + - name: Tauri build + uses: tauri-apps/tauri-action@v0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + projectPath: "./tauri" diff --git a/.github/workflows/tag-release.yaml b/.github/workflows/tag-release.yaml index f4d5a0b..1345c32 100644 --- a/.github/workflows/tag-release.yaml +++ b/.github/workflows/tag-release.yaml @@ -36,3 +36,64 @@ jobs: ORG: ${{ github.repository_owner }} REPO: ${{ github.event.repository.name }} GITHUB_WORKFLOW: ${{ github.workflow }} + + build-tauri: + runs-on: [macos-latest] + permissions: + contents: write + steps: + - name: Checkout code + 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: Set up Nodejs + uses: actions/setup-node@v4 + with: + node-version: "lts/*" + cache: "npm" + + - name: Install Frontend deps + run: | + npm install + + - name: Populate key + run: | + echo "${{ secrets.APPLE_API_KEY_B64 }}"|base64 --decode > ./apple.p8 + + - name: get release version + id: get_release_version + run: echo "TAG=${GITHUB_REF#refs/tags/}"" >> $GITHUB_ENV + + - name: Build the app + uses: tauri-apps/tauri-action@v0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} + APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} + APPLE_API_KEY_PATH: ./apple.p8 + APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} + APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} + with: + releaseId: ${process.env.TAG} + + - name: publish release + id: publish-release + uses: actions/github-script@v7 + with: + script: | + github.rest.repos.updateRelease({ + owner: context.repo.owner, + repo: context.repo.repo, + release_id: process.env.TAG, + }) diff --git a/tauri/scripts/bundle-prep.sh b/tauri/scripts/bundle-prep.sh index 09f6aba..4d7902b 100755 --- a/tauri/scripts/bundle-prep.sh +++ b/tauri/scripts/bundle-prep.sh @@ -1,3 +1,7 @@ #!/bin/bash +pushd $(dirname $0)/.. + +mkdir -p ./src-tauri/assets cp ../docker-compose.yml ./src-tauri/assets/docker-compose.yml +popd \ No newline at end of file