Skip to content

Commit b8720be

Browse files
committed
feat: tauri release
- code signing - release to CrabNebula - update icons
1 parent 869fe9e commit b8720be

35 files changed

+749
-211
lines changed
Lines changed: 66 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,46 @@
11
name: 'Build for Linux'
22
description: 'Build for Linux'
33
inputs:
4+
production-release:
5+
description: 'Whether this is a production release'
6+
required: true
47
release-version:
58
description: 'The release version'
9+
required: true
10+
release-tag:
11+
description: 'The release tag'
12+
required: true
13+
crabnebula-release-id:
14+
description: 'The CrabNebula release ID'
15+
required: true
16+
tauri-signing-private-key:
17+
description: 'The Tauri signing private key'
18+
required: true
19+
tauri-signing-private-key-password:
20+
description: 'The Tauri signing private key password'
21+
required: true
22+
tauri-signing-public-key:
23+
description: 'The Tauri signing public key'
24+
required: true
25+
crabnebula-org-name:
26+
description: 'The CrabNebula org name'
27+
required: true
28+
crabnebula-app-name:
29+
description: 'The CrabNebula app name'
30+
required: true
31+
crabnebula-api-key:
32+
description: 'The CrabNebula API key'
33+
required: true
34+
appimage-signing-private-key:
35+
description: 'The AppImage signing private key'
36+
required: true
37+
appimage-signing-private-key-password:
38+
description: 'The AppImage signing private key password'
39+
required: true
640

741
runs:
842
using: 'composite'
943
steps:
10-
- name: Get artifact name
11-
id: set-env
12-
run: |
13-
echo "artifact_name=algokit-lora-linux-${{ runner.arch }}" >> $GITHUB_OUTPUT
14-
shell: bash
15-
1644
- name: Install dependencies
1745
run: |
1846
sudo apt-get update
@@ -24,42 +52,49 @@ runs:
2452
libxdo-dev \
2553
libssl-dev \
2654
libayatana-appindicator3-dev \
27-
librsvg2-dev
55+
librsvg2-dev \
56+
gnupg2
2857
shell: bash
2958

30-
- name: Bump version in tauri.conf.json
59+
- name: Setup tauri.conf.json
3160
if: ${{ inputs.release-version != '' }}
3261
run: |
33-
sed -i "s/\"version\": \"0.0.0\"/\"version\": \"${{ inputs.release-version }}\"/g" "src-tauri/tauri.conf.json"
62+
sed -i "s/\"version\": \"0.1.0\"/\"version\": \"${{ inputs.release-version }}\"/g" "src-tauri/tauri.conf.json"
63+
sed -i "s/\"createUpdaterArtifacts\": false/\"createUpdaterArtifacts\": true/g" "src-tauri/tauri.conf.json"
64+
sed -i "s/CN_ORG_NAME/${{ inputs.crabnebula-org-name }}/g" "src-tauri/tauri.conf.json"
65+
sed -i "s/CN_APP_NAME/${{ inputs.crabnebula-app-name }}/g" "src-tauri/tauri.conf.json"
66+
sed -i "s/CN_CHANNEL/${{ inputs.production-release != 'true' && '?channel=beta' || '' }}/g" "src-tauri/tauri.conf.json"
67+
sed -i "s/TAURI_SIGNING_PUBLIC_KEY/${{ inputs.tauri-signing-public-key }}/g" "src-tauri/tauri.conf.json"
3468
shell: bash
3569

36-
- name: Build tauri app
70+
- name: Import AppImage signing key
3771
run: |
38-
npm run tauri build
72+
echo "${{ inputs.appimage-signing-private-key }}" > appimage.key
73+
gpg2 --batch --passphrase ${{ inputs.appimage-signing-private-key-password }} --import appimage.key
3974
shell: bash
4075

41-
- name: Create icons and desktop file
42-
run: |
43-
chmod +x ./scripts/snap/create-desktop-file.sh
44-
./scripts/snap/create-desktop-file.sh ${{ github.workspace }}/src-tauri/target/release
45-
cp ${{ github.workspace }}/src-tauri/icons ${{ github.workspace }}/src-tauri/target/release/icons -r
46-
shell: bash
47-
48-
- name: Zip to preserve permissions
76+
- name: Build tauri app
4977
run: |
50-
cd src-tauri/target/release
51-
tar -czvf ${{ github.workspace }}/${{ steps.set-env.outputs.artifact_name }}.tar.gz --exclude=bundle --exclude=build --exclude=deps .
78+
npm run tauri build -- --bundles appimage
5279
shell: bash
80+
env:
81+
TAURI_SIGNING_PRIVATE_KEY: ${{ inputs.tauri-signing-private-key }}
82+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ inputs.tauri-signing-private-key-password }}
83+
SIGN: 1
84+
APPIMAGETOOL_SIGN_PASSPHRASE: ${{ inputs.appimage-signing-private-key-password }}
85+
APPIMAGETOOL_FORCE_SIGN: 1
5386

54-
- name: Upload binary as artifact
55-
id: upload-artifact
56-
uses: actions/upload-artifact@v4
87+
- name: Upload artifacts to release
88+
uses: softprops/action-gh-release@v1
5789
with:
58-
if-no-files-found: error
59-
name: ${{ steps.set-env.outputs.artifact_name }}
60-
path: ${{ github.workspace }}/${{ steps.set-env.outputs.artifact_name }}.tar.gz
90+
fail_on_unmatched_files: true
91+
files: |
92+
src-tauri/target/release/bundle/appimage/algokit-lora*.AppImage
93+
tag_name: ${{ inputs.release-tag }}
94+
prerelease: ${{ inputs.production-release != 'true' }}
6195

62-
outputs:
63-
artifact-name:
64-
description: 'The name of the artifact'
65-
value: ${{ steps.set-env.outputs.artifact_name }}.tar.gz
96+
- name: Upload artifacts to CrabNebula
97+
uses: crabnebula-dev/[email protected]
98+
with:
99+
command: release upload "${{ inputs.crabnebula-org-name }}/${{ inputs.crabnebula-app-name }}" --framework tauri ${{ inputs.production-release != 'true' && '--channel beta' || '' }}
100+
api-key: ${{ inputs.crabnebula-api-key }}

.github/actions/build-mac/action.yaml

Lines changed: 94 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,117 @@ name: 'Build for Mac'
22
description: 'Build for Mac'
33
inputs:
44
production-release:
5-
description: 'Production release?'
5+
description: 'Whether this is a production release'
66
required: true
77
release-version:
88
description: 'The release version'
9+
required: true
10+
release-tag:
11+
description: 'The release tag'
12+
required: true
13+
crabnebula-release-id:
14+
description: 'The CrabNebula release ID'
15+
required: true
16+
apple-certificate:
17+
description: 'The Apple certificate'
18+
required: true
19+
apple-certificate-password:
20+
description: 'The Apple certificate password'
21+
required: true
22+
keychain-password:
23+
description: 'The keychain password'
24+
required: true
25+
apple-id:
26+
description: 'The Apple ID'
27+
required: true
28+
apple-password:
29+
description: 'The Apple password'
30+
required: true
31+
apple-team-id:
32+
description: 'The Apple team ID'
33+
required: true
34+
tauri-signing-private-key:
35+
description: 'The Tauri signing private key'
36+
required: true
37+
tauri-signing-private-key-password:
38+
description: 'The Tauri signing private key password'
39+
required: true
40+
tauri-signing-public-key:
41+
description: 'The Tauri signing public key'
42+
required: true
43+
crabnebula-org-name:
44+
description: 'The CrabNebula org name'
45+
required: true
46+
crabnebula-app-name:
47+
description: 'The CrabNebula app name'
48+
required: true
49+
crabnebula-api-key:
50+
description: 'The CrabNebula API key'
51+
required: true
952

1053
runs:
1154
using: 'composite'
1255
steps:
13-
# TODO: set up signing certs here when releasing to production
14-
15-
- name: Get artifact name
16-
id: set-env
56+
- name: Import Apple Developer Certificate
57+
env:
58+
APPLE_CERTIFICATE: ${{ inputs.apple-certificate }}
59+
APPLE_CERTIFICATE_PASSWORD: ${{ inputs.apple-certificate-password }}
60+
KEYCHAIN_PASSWORD: ${{ inputs.keychain-password }}
61+
shell: bash
1762
run: |
18-
echo "artifact_name=algokit-lora-mac-${{ runner.arch }}" >> $GITHUB_OUTPUT
63+
echo $APPLE_CERTIFICATE | base64 --decode > certificate.p12
64+
security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
65+
security default-keychain -s build.keychain
66+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
67+
security set-keychain-settings -t 3600 -u build.keychain
68+
security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
69+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain
70+
security find-identity -v -p codesigning build.keychain
71+
72+
- name: Verify Certificate
1973
shell: bash
74+
run: |
75+
CERT_INFO=$(security find-identity -v -p codesigning build.keychain | grep "Developer ID Application")
76+
CERT_ID=$(echo "$CERT_INFO" | awk -F'"' '{print $2}')
77+
echo "CERT_ID=$CERT_ID" >> $GITHUB_ENV
78+
echo "Certificate imported."
2079
21-
- name: Bump version in tauri.conf.json
80+
- name: Setup tauri.conf.json
2281
if: ${{ inputs.release-version != '' }}
2382
run: |
24-
sed -i '' "s/\"version\": \"0.0.0\"/\"version\": \"${{ inputs.release-version }}\"/g" "src-tauri/tauri.conf.json"
83+
sed -i '' "s/\"version\": \"0.1.0\"/\"version\": \"${{ inputs.release-version }}\"/g" "src-tauri/tauri.conf.json"
84+
sed -i '' "s/\"createUpdaterArtifacts\": false/\"createUpdaterArtifacts\": true/g" "src-tauri/tauri.conf.json"
85+
sed -i '' "s/CN_ORG_NAME/${{ inputs.crabnebula-org-name }}/g" "src-tauri/tauri.conf.json"
86+
sed -i '' "s/CN_APP_NAME/${{ inputs.crabnebula-app-name }}/g" "src-tauri/tauri.conf.json"
87+
sed -i '' "s/CN_CHANNEL/${{ inputs.production-release != 'true' && '?channel=beta' || '' }}/g" "src-tauri/tauri.conf.json"
88+
sed -i '' "s/TAURI_SIGNING_PUBLIC_KEY/${{ inputs.tauri-signing-public-key }}/g" "src-tauri/tauri.conf.json"
2589
shell: bash
2690

2791
- name: Build tauri app
2892
run: |
2993
npm run tauri build
3094
shell: bash
95+
env:
96+
APPLE_CERTIFICATE: ${{ inputs.apple-certificate }}
97+
APPLE_CERTIFICATE_PASSWORD: ${{ inputs.apple-certificate-password }}
98+
APPLE_SIGNING_IDENTITY: ${{ env.CERT_ID }}
99+
APPLE_ID: ${{ inputs.apple-id }}
100+
APPLE_PASSWORD: ${{ inputs.apple-password }}
101+
APPLE_TEAM_ID: ${{ inputs.apple-team-id }}
102+
TAURI_SIGNING_PRIVATE_KEY: ${{ inputs.tauri-signing-private-key }}
103+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ inputs.tauri-signing-private-key-password }}
104+
105+
- name: Upload artifacts to release
106+
uses: softprops/action-gh-release@v1
107+
with:
108+
fail_on_unmatched_files: true
109+
files: |
110+
src-tauri/target/release/bundle/dmg/algokit-lora_*.dmg
111+
tag_name: ${{ inputs.release-tag }}
112+
prerelease: ${{ inputs.production-release != 'true' }}
31113

32-
- name: Upload binary as artifact
33-
id: upload-artifact
34-
uses: actions/upload-artifact@v4
114+
- name: Upload artifacts to CrabNebula
115+
uses: crabnebula-dev/[email protected]
35116
with:
36-
if-no-files-found: error
37-
name: ${{ steps.set-env.outputs.artifact_name }}
38-
path: src-tauri/target/release/bundle/dmg/algokit-lora_*.dmg
117+
command: release upload "${{ inputs.crabnebula-org-name }}/${{ inputs.crabnebula-app-name }}" --framework tauri ${{ inputs.production-release != 'true' && '--channel beta' || '' }}
118+
api-key: ${{ inputs.crabnebula-api-key }}

.github/actions/build-windows/action.yaml

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@ name: 'Build for Windows'
22
description: 'Build for Windows'
33
inputs:
44
production-release:
5-
description: 'Production release?'
5+
description: 'Whether this is a production release'
66
required: true
77
release-version:
88
description: 'The release version'
9-
package_name:
10-
description: 'The name of the package'
9+
required: true
10+
release-tag:
11+
description: 'The release tag'
12+
required: true
13+
crabnebula-release-id:
14+
description: 'The CrabNebula release ID'
1115
required: true
1216
azure_tenant_id:
1317
description: 'The Microsoft Entra tenant (directory) ID.'
@@ -18,23 +22,39 @@ inputs:
1822
azure_client_secret:
1923
description: 'A client secret that was generated for the App Registration.'
2024
required: true
25+
tauri-signing-private-key:
26+
description: 'The Tauri signing private key'
27+
required: true
28+
tauri-signing-private-key-password:
29+
description: 'The Tauri signing private key password'
30+
required: true
31+
tauri-signing-public-key:
32+
description: 'The Tauri signing public key'
33+
required: true
34+
crabnebula-org-name:
35+
description: 'The CrabNebula org name'
36+
required: true
37+
crabnebula-app-name:
38+
description: 'The CrabNebula app name'
39+
required: true
40+
crabnebula-api-key:
41+
description: 'The CrabNebula API key'
42+
required: true
2143

2244
runs:
2345
using: 'composite'
2446
steps:
25-
- name: Get artifact name
26-
id: set-env
27-
run: |
28-
echo "artifact_name=algokit-lora-windows-${{ runner.arch }}" >> $GITHUB_OUTPUT
29-
shell: bash
30-
31-
- name: Bump version in tauri.conf.json and Cargo files
47+
- name: Setup tauri.conf.json
3248
if: ${{ inputs.release-version != '' }}
3349
run: |
34-
version="${{ inputs.release-version }}"
35-
sed -i "s/\"version\": \"0.0.0\"/\"version\": \"$version\"/g" "src-tauri/tauri.conf.json"
36-
sed -i "s/version = \"0.0.0\"/version = \"$version\"/g" "src-tauri/Cargo.toml"
37-
sed -i "s/version = \"0.0.0\"/version = \"$version\"/g" "src-tauri/Cargo.lock"
50+
input_version="${{ inputs.release-version }}"
51+
version="${input_version/beta./""}"
52+
sed -i "s/\"version\": \"0.1.0\"/\"version\": \"$version\"/g" "src-tauri/tauri.conf.json"
53+
sed -i "s/\"createUpdaterArtifacts\": false/\"createUpdaterArtifacts\": true/g" "src-tauri/tauri.conf.json"
54+
sed -i "s/CN_ORG_NAME/${{ inputs.crabnebula-org-name }}/g" "src-tauri/tauri.conf.json"
55+
sed -i "s/CN_APP_NAME/${{ inputs.crabnebula-app-name }}/g" "src-tauri/tauri.conf.json"
56+
sed -i "s/CN_CHANNEL/${{ inputs.production-release != 'true' && '?channel=beta' || '' }}/g" "src-tauri/tauri.conf.json"
57+
sed -i "s/TAURI_SIGNING_PUBLIC_KEY/${{ inputs.tauri-signing-public-key }}/g" "src-tauri/tauri.conf.json"
3858
shell: bash
3959

4060
# Create a dummy file to sign, so we can install the signing tools without any errors
@@ -76,6 +96,8 @@ runs:
7696
AZURE_TENANT_ID: ${{ inputs.azure_tenant_id }}
7797
AZURE_CLIENT_ID: ${{ inputs.azure_client_id }}
7898
AZURE_CLIENT_SECRET: ${{ inputs.azure_client_secret }}
99+
TAURI_SIGNING_PRIVATE_KEY: ${{ inputs.tauri-signing-private-key }}
100+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ inputs.tauri-signing-private-key-password }}
79101
run: |
80102
npm run tauri build
81103
shell: pwsh
@@ -95,9 +117,18 @@ runs:
95117
timestamp-rfc3161: http://timestamp.acs.microsoft.com
96118
timestamp-digest: SHA256
97119

98-
- name: Upload installer artifact
99-
uses: actions/upload-artifact@v4
120+
- name: Upload artifacts to release
121+
uses: softprops/action-gh-release@v1
122+
with:
123+
fail_on_unmatched_files: true
124+
files: |
125+
src-tauri/target/release/bundle/msi/algokit-lora*.msi
126+
src-tauri/target/release/bundle/nsis/algokit-lora*.exe
127+
tag_name: ${{ inputs.release-tag }}
128+
prerelease: ${{ inputs.production-release != 'true' }}
129+
130+
- name: Upload artifacts to CrabNebula
131+
uses: crabnebula-dev/[email protected]
100132
with:
101-
if-no-files-found: error
102-
name: ${{ steps.set-env.outputs.artifact_name }}
103-
path: ${{ github.workspace }}\src-tauri\target\release\bundle\msi\algokit-lora*.msi
133+
command: release upload "${{ inputs.crabnebula-org-name }}/${{ inputs.crabnebula-app-name }}" "${{ inputs.crabnebula-release-id }}" --framework tauri ${{ inputs.production-release != 'true' && '--channel beta' || '' }}
134+
api-key: ${{ inputs.crabnebula-api-key }}

.github/actions/create-release/action.yaml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,15 @@ runs:
3939

4040
- name: Get next version (dry run)
4141
id: get-next-version
42-
run: npx semantic-release --dry-run
42+
run: npx semantic-release --dry-run ${{ inputs.production-release == 'true' && '--branches main' || '' }}
4343
env:
4444
GITHUB_TOKEN: ${{ inputs.github-token }}
4545
shell: bash
4646

47-
- name: Create release - beta
48-
if: ${{ inputs.production-release != 'true' }}
47+
- name: Create release ${{ inputs.production-release == 'true' && '' || 'beta' }}
4948
env:
5049
GITHUB_TOKEN: ${{ inputs.github-token }}
51-
run: 'npx semantic-release'
52-
shell: bash
53-
54-
- name: Create release
55-
if: ${{ inputs.production-release == 'true' }}
56-
env:
57-
GITHUB_TOKEN: ${{ inputs.github-token }}
58-
run: 'npx semantic-release --branches main'
50+
run: npx semantic-release ${{ inputs.production-release == 'true' && '--branches main' || '' }}
5951
shell: bash
6052

6153
- name: Get release tag
@@ -73,6 +65,6 @@ runs:
7365
const { data } = await github.rest.repos.getReleaseByTag({
7466
owner: context.repo.owner,
7567
repo: context.repo.repo,
76-
tag: "${{ steps.get-release-tag.outputs.release-tag }}"
68+
tag: "${{ steps.get-next-version.outputs.new-release-git-tag }}"
7769
})
7870
return data.id

0 commit comments

Comments
 (0)