Skip to content

Commit fd647db

Browse files
committed
update desktop_cd
1 parent 26736f1 commit fd647db

File tree

1 file changed

+25
-39
lines changed

1 file changed

+25
-39
lines changed

.github/workflows/desktop_cd.yaml

Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,21 @@
11
# https://docs.crabnebula.dev/cloud/ci/tauri-v2-workflow/
22
on:
33
workflow_dispatch:
4-
inputs:
5-
channel:
6-
description: "Release channel to use. Defaults to 'stable' for manual runs, 'nightly' for automated releases"
7-
required: false
8-
default: "stable"
9-
type: choice
10-
options:
11-
- "stable"
12-
- "nightly"
13-
runner:
14-
description: "Type of runner to use."
15-
required: false
16-
default: "github"
17-
type: choice
18-
options:
19-
- "warp"
20-
- "github"
214
release:
225
types:
236
- published
24-
- prereleased
7+
258
concurrency:
269
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
2710
cancel-in-progress: true
2811
env:
2912
CN_APPLICATION: "fastrepl/hyprnote"
30-
RELEASE_CHANNEL: ${{ github.event_name == 'workflow_dispatch' && inputs.channel || 'nightly' }}
31-
TAURI_CONF_PATH: ${{ (github.event_name == 'workflow_dispatch' && inputs.channel == 'stable') && './src-tauri/tauri.conf.stable.json' || './src-tauri/tauri.conf.nightly.json' }}
13+
RELEASE_CHANNEL: ${{ (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')) && 'nightly' || (github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/tags/')) && 'stable' || 'staging' }}
14+
TAURI_CONF_PATH: ${{ (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')) && './src-tauri/tauri.conf.nightly.json' || (github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/tags/')) && './src-tauri/tauri.conf.stable.json' || './src-tauri/tauri.conf.staging.json' }}
15+
3216
jobs:
33-
draft:
34-
if: ${{ github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, 'desktop_') }}
35-
runs-on: ubuntu-24.04
36-
steps:
37-
- uses: actions/checkout@v4
38-
- uses: ./.github/actions/cn_release
39-
with:
40-
cmd: draft
41-
app: ${{ env.CN_APPLICATION }}
42-
key: ${{ secrets.CN_API_KEY }}
43-
channel: ${{ env.RELEASE_CHANNEL }}
44-
framework: tauri
45-
working-directory: ./apps/desktop
4617
build:
47-
if: ${{ github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, 'desktop_') }}
48-
needs: draft
18+
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && startsWith(github.event.release.tag_name, 'desktop_')) }}
4919
permissions:
5020
contents: write
5121
strategy:
@@ -60,7 +30,7 @@ jobs:
6030
runner: "macos-latest"
6131
# - platform: "windows"
6232
# target: "x86_64-pc-windows-msvc"
63-
# runner: "${{ inputs.runner == 'warp' && 'warp-windows-latest-x64-4x' || 'windows-latest' }}"
33+
# runner: "windows-latest"
6434
runs-on: ${{ matrix.runner }}
6535
defaults:
6636
run:
@@ -78,6 +48,15 @@ jobs:
7848
fi
7949
fi
8050
shell: bash
51+
- if: ${{ env.RELEASE_CHANNEL != 'staging' }}
52+
uses: ./.github/actions/cn_release
53+
with:
54+
cmd: draft
55+
app: ${{ env.CN_APPLICATION }}
56+
key: ${{ secrets.CN_API_KEY }}
57+
channel: ${{ env.RELEASE_CHANNEL }}
58+
framework: tauri
59+
working-directory: ./apps/desktop
8160
- uses: ./.github/actions/setup_protoc
8261
with:
8362
repo-token: ${{ secrets.GITHUB_TOKEN }}
@@ -116,7 +95,7 @@ jobs:
11695
chmod +x ./apps/desktop/src-tauri/binaries/passthrough-${{ matrix.target }}
11796
codesign --force --options runtime -s "${{ steps.apple-cert.outputs.cert-id }}" ./apps/desktop/src-tauri/binaries/stt-${{ matrix.target }}
11897
codesign -dv ./apps/desktop/src-tauri/binaries/stt-${{ matrix.target }}
119-
./scripts/sidecar.sh "./apps/desktop/src-tauri/tauri.conf.${{ env.RELEASE_CHANNEL }}.json" "binaries/stt"
98+
./scripts/sidecar.sh "./apps/desktop/${{ env.TAURI_CONF_PATH }}" "binaries/stt"
12099
- run: pnpm -F desktop tauri build --target ${{ matrix.target }} --config ${{ env.TAURI_CONF_PATH }} --verbose
121100
env:
122101
# https://github.com/tauri-apps/tauri-action/issues/740
@@ -145,16 +124,23 @@ jobs:
145124
fi
146125
shell: bash
147126
working-directory: ./apps/desktop/src-tauri
148-
- uses: ./.github/actions/cn_release
127+
- if: ${{ env.RELEASE_CHANNEL != 'staging' }}
128+
uses: ./.github/actions/cn_release
149129
with:
150130
cmd: upload
151131
app: ${{ env.CN_APPLICATION }}
152132
key: ${{ secrets.CN_API_KEY }}
153133
channel: ${{ env.RELEASE_CHANNEL }}
154134
framework: tauri
155135
working-directory: ./apps/desktop
136+
- if: ${{ env.RELEASE_CHANNEL == 'staging' }}
137+
uses: actions/upload-artifact@v4
138+
with:
139+
name: hyprnote-staging-${{ matrix.target }}
140+
path: apps/desktop/src-tauri/target/${{ matrix.target }}/release/bundle/dmg/*.dmg
141+
retention-days: 3
156142
publish:
157-
if: ${{ github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, 'desktop_') }}
143+
if: ${{ ((github.event_name == 'workflow_dispatch') || (github.event_name == 'release' && startsWith(github.event.release.tag_name, 'desktop_'))) && ((github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/tags/'))) && env.RELEASE_CHANNEL != 'staging' }}
158144
needs: build
159145
runs-on: ubuntu-24.04
160146
steps:

0 commit comments

Comments
 (0)