1- name : Build App
1+ name : Build App (Manual)
22
33on :
4- push :
5- tags :
6- - ' v*'
4+ workflow_dispatch :
5+ inputs :
6+ version :
7+ description : ' Version to build (leave empty to use current version with commit hash)'
8+ required : false
9+ type : string
710
811jobs :
9- release -app :
12+ build -app :
1013 permissions :
1114 contents : write
1215 strategy :
2831 - name : Checkout Repository
2932 uses : actions/checkout@v4
3033
34+ - name : Set version for manual trigger
35+ run : |
36+ if [ -n "${{ github.event.inputs.version }}" ]; then
37+ VERSION="${{ github.event.inputs.version }}"
38+ else
39+ # Get current version from package.json and add commit hash
40+ CURRENT_VERSION=$(node -p "require('./package.json').version")
41+ COMMIT_HASH=$(git rev-parse --short HEAD)
42+ VERSION="${CURRENT_VERSION}-${COMMIT_HASH}"
43+ fi
44+ echo "CUSTOM_VERSION=$VERSION" >> $GITHUB_ENV
45+ echo "Custom version set to: $VERSION"
46+
3147 - name : Setup Node.js
3248 uses : actions/setup-node@v4
3349 with :
@@ -54,81 +70,42 @@ jobs:
5470 - name : Install Frontend Dependencies
5571 run : pnpm install
5672
57- - name : Import Apple Developer Certificate
58- if : matrix.platform == 'macos-latest'
59- # Prevents keychain from locking automatically for 3600 seconds.
60- env :
61- APPLE_API_KEY_CONTENT : ${{ secrets.APPLE_API_KEY_CONTENT }}
62- APPLE_CERTIFICATE : ${{ secrets.APPLE_CERTIFICATE }}
63- APPLE_CERTIFICATE_PASSWORD : ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
64- KEYCHAIN_PASSWORD : ${{ secrets.KEYCHAIN_PASSWORD }}
65- run : |
66- echo $APPLE_API_KEY_CONTENT | base64 --decode > authkey.p8
67-
68- echo $APPLE_CERTIFICATE | base64 --decode > certificate.p12
69- security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
70- security default-keychain -s build.keychain
71- security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
72- security set-keychain-settings -t 3600 -u build.keychain
73- security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
74- security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain
75- security find-identity -v -p codesigning build.keychain
76-
77- - name : Verify Apple Developer Certificate
78- if : matrix.platform == 'macos-latest'
79- run : |
80- CERT_INFO=$(security find-identity -v -p codesigning build.keychain | grep "Developer ID Application")
81- CERT_ID=$(echo "$CERT_INFO" | awk -F'"' '{print $2}')
82- echo "CERT_ID=$CERT_ID" >> $GITHUB_ENV
83- echo "Certificate imported."
84-
85- - name : Build the App
73+ - name : Build the App (without signing)
74+ id : build
8675 uses : tauri-apps/tauri-action@v0
87- env :
88- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
89- APPLE_ID : ${{ secrets.APPLE_ID }}
90- APPLE_ID_PASSWORD : ${{ secrets.APPLE_ID_PASSWORD }}
91- APPLE_TEAM_ID : ${{ secrets.APPLE_TEAM_ID }}
92- APPLE_CERTIFICATE : ${{ secrets.APPLE_CERTIFICATE }}
93- APPLE_CERTIFICATE_PASSWORD : ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
94- APPLE_SIGNING_IDENTITY : ${{ env.CERT_ID }}
95-
96- APPLE_PASSWORD : ${{ secrets.APPLE_PASSWORD }}
97- APPLE_API_ISSUER : ${{ secrets.APPLE_API_ISSUER }}
98- APPLE_API_KEY : ${{ secrets.APPLE_API_KEY }}
99- APPLE_API_KEY_PATH : authkey.p8
100-
101- TAURI_SIGNING_PRIVATE_KEY : ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
102- TAURI_SIGNING_PRIVATE_KEY_PASSWORD : ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
10376 with :
104- tagName : ${{ github.ref_name || 'v__VERSION__' }} # This only works if your workflow triggers on new tags.
105- releaseName : ' DevUtility v__VERSION__' # tauri-action replaces \_\_VERSION\_\_ with the app version.
106- releaseBody : ' See the assets to download and install this version.'
107- releaseDraft : true
108- prerelease : false
10977 args : ${{ matrix.args }}
110-
111- update-changelog :
112- runs-on : ubuntu-latest
113-
114- permissions :
115- contents : write
116-
117- env :
118- RELEASE_TAG : ${{ github.ref_name }}
119-
120- steps :
121- - name : Checkout code
122- uses : actions/checkout@v4
123- with :
124- fetch-depth : 0
78+ includeDebug : true
12579
126- - uses : orhun/git-cliff-action@v4
127- id : git-cliff
128- with :
129- args : --latest --strip header
130-
131- - uses : softprops/action-gh-release@v1
80+ - name : Upload build artifacts (macOS/Linux)
81+ if : matrix.platform != 'windows-latest'
82+ run : |
83+ mkdir -p artifacts
84+ paths=$(echo '${{ steps.build.outputs.artifactPaths }}' | jq -c '.[]' | sed 's/"//g')
85+ for fn in $paths; do
86+ if [[ -f $fn ]]; then
87+ echo "Copying $fn to artifacts/"
88+ cp "$fn" artifacts/
89+ fi
90+ done
91+
92+ - name : Upload build artifacts (Windows)
93+ if : matrix.platform == 'windows-latest'
94+ shell : pwsh
95+ run : |
96+ New-Item -ItemType Directory -Force -Path artifacts
97+ $jsonString = '${{ steps.build.outputs.artifactPaths }}'
98+ $filePaths = ConvertFrom-Json $jsonString
99+ foreach ($path in $filePaths) {
100+ if (Test-Path $path -PathType Leaf) {
101+ Write-Host "Copying $path to artifacts/"
102+ Copy-Item $path artifacts/
103+ }
104+ }
105+
106+ - name : Upload artifacts
107+ uses : actions/upload-artifact@v4
132108 with :
133- body : ${{ steps.git-cliff.outputs.content }}
134- tag_name : ${{ env.RELEASE_TAG }}
109+ name : build-artifacts-${{ matrix.platform }}-${{ env.CUSTOM_VERSION }}
110+ path : artifacts/
111+ retention-days : 30
0 commit comments