Skip to content

Commit 4416682

Browse files
authored
Merge pull request #336 from smolcars/fix-ios-build-artifacts
Add iOS xcarchive to GitHub Action release
2 parents 3b964f6 + d1da791 commit 4416682

4 files changed

Lines changed: 50 additions & 80 deletions

File tree

.github/workflows/ios-device-build.yml

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ env:
99
1010
on:
1111
workflow_call:
12-
inputs:
13-
variant:
14-
description: "The iOS app variant to build"
15-
required: false
16-
default: "signet"
17-
type: string
1812
outputs:
1913
artifact_name:
2014
description: "The name of the uploaded artifact"
@@ -37,61 +31,28 @@ jobs:
3731
- name: 📦 Install dependencies
3832
run: nix develop .# --command bash -c "bun install --frozen-lockfile"
3933

40-
- name: 🧭 Resolve build variant
41-
id: variant
42-
shell: bash
43-
env:
44-
BUILD_VARIANT: ${{ inputs.variant }}
45-
run: |
46-
set -euo pipefail
47-
48-
case "$BUILD_VARIANT" in
49-
mainnet)
50-
echo "app_name=Noah.app" >> "$GITHUB_OUTPUT"
51-
echo "artifact_name=noah-ios-mainnet" >> "$GITHUB_OUTPUT"
52-
echo "build_script=build:ios:mainnet:device" >> "$GITHUB_OUTPUT"
53-
echo "ipa_filename=noah-mainnet.ipa" >> "$GITHUB_OUTPUT"
54-
;;
55-
signet)
56-
echo "app_name=Noah-Signet.app" >> "$GITHUB_OUTPUT"
57-
echo "artifact_name=noah-ios-signet" >> "$GITHUB_OUTPUT"
58-
echo "build_script=build:ios:signet:device" >> "$GITHUB_OUTPUT"
59-
echo "ipa_filename=noah-signet.ipa" >> "$GITHUB_OUTPUT"
60-
;;
61-
*)
62-
echo "Unsupported iOS variant '$BUILD_VARIANT'. Use 'mainnet' or 'signet'."
63-
exit 1
64-
;;
65-
esac
66-
67-
- name: 🔧 Create sentry.properties
68-
if: ${{ inputs.variant == 'mainnet' }}
69-
env:
70-
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
71-
run: ./scripts/create_sentry_properties.sh
72-
7334
- name: 🛠️ Build for device
74-
run: nix develop .# --command bash -c "bun client ios:prebuild && bun client ${{ steps.variant.outputs.build_script }}"
35+
run: nix develop .# --command bash -c "bun client ios:prebuild && bun client build:ios:signet:device"
7536

7637
- name: 📦 Create IPA
7738
run: |
7839
mkdir -p client/ios/build/ipa
7940
mkdir -p Payload
80-
cp -R "client/ios/build/Build/Products/Release-iphoneos/${{ steps.variant.outputs.app_name }}" Payload/
81-
zip -r "client/ios/build/ipa/${{ steps.variant.outputs.ipa_filename }}" Payload
41+
cp -R client/ios/build/Build/Products/Release-iphoneos/Noah-Signet.app Payload/
42+
zip -r client/ios/build/ipa/noah-signet.ipa Payload
8243
rm -rf Payload
8344
8445
- name: 📁 Set outputs
8546
id: set_outputs
8647
run: |
87-
echo "artifact_name=${{ steps.variant.outputs.artifact_name }}" >> $GITHUB_OUTPUT
88-
echo "ipa_filename=${{ steps.variant.outputs.ipa_filename }}" >> $GITHUB_OUTPUT
48+
echo "artifact_name=noah-ios-signet" >> $GITHUB_OUTPUT
49+
echo "ipa_filename=noah-signet.ipa" >> $GITHUB_OUTPUT
8950
9051
- name: 📤 Upload IPA artifact
9152
uses: actions/upload-artifact@v7
9253
with:
9354
name: ${{ steps.set_outputs.outputs.artifact_name }}
94-
path: client/ios/build/ipa/${{ steps.set_outputs.outputs.ipa_filename }}
55+
path: client/ios/build/ipa/noah-signet.ipa
9556
if-no-files-found: error
9657
overwrite: true
9758

@@ -100,5 +61,3 @@ jobs:
10061
run: |
10162
rm -rf client/ios/build
10263
rm -rf Payload
103-
rm -f client/android/sentry.properties
104-
rm -f client/ios/sentry.properties

.github/workflows/ios-telegram.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ jobs:
1616
build:
1717
name: Build iOS Device App
1818
uses: ./.github/workflows/ios-device-build.yml
19-
with:
20-
variant: signet
2119
secrets: inherit
2220

2321
upload_and_notify:

.github/workflows/release.yml

Lines changed: 43 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,54 @@ jobs:
2020
git_ref: ${{ github.ref }}
2121
secrets: inherit
2222

23-
ios-signet-build:
24-
name: Build iOS Signet IPA
25-
uses: ./.github/workflows/ios-device-build.yml
26-
with:
27-
variant: signet
28-
secrets: inherit
23+
ios-mainnet-archive:
24+
name: Build iOS Mainnet Archive
25+
runs-on: macOS
26+
env:
27+
# Self-hosted runners persist /nix/store; avoid stale Magic Nix Cache hooks/proxies.
28+
NIX_CONFIG: |
29+
post-build-hook =
30+
extra-substituters =
31+
substituters = https://cache.nixos.org/
32+
steps:
33+
- name: 🏗 Checkout repository
34+
uses: actions/checkout@v6
2935

30-
ios-mainnet-build:
31-
name: Build iOS Mainnet IPA
32-
uses: ./.github/workflows/ios-device-build.yml
33-
with:
34-
variant: mainnet
35-
secrets: inherit
36+
- name: 📦 Install dependencies
37+
run: nix develop .# --command bash -c "bun install --frozen-lockfile"
38+
39+
- name: 🔧 Create sentry.properties
40+
env:
41+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
42+
run: ./scripts/create_sentry_properties.sh
43+
44+
- name: 🛠️ Build development-signed archive
45+
run: nix develop .# --command bash -c "bun client ios:prebuild && bun client build:ios:mainnet:archive"
46+
47+
- name: 📦 Package archive
48+
run: |
49+
tar -czf client/ios/build/noah-mainnet.xcarchive.tar.gz \
50+
-C client/ios/build Noah-mainnet.xcarchive
51+
52+
- name: 📤 Upload archive artifact
53+
uses: actions/upload-artifact@v7
54+
with:
55+
path: client/ios/build/noah-mainnet.xcarchive.tar.gz
56+
archive: false
57+
if-no-files-found: error
58+
retention-days: 90
59+
60+
- name: 🧹 Clean up build artifacts
61+
if: always()
62+
run: |
63+
rm -rf client/ios/build
64+
rm -f client/android/sentry.properties
65+
rm -f client/ios/sentry.properties
3666
3767
release:
3868
name: Create GitHub Release
3969
runs-on: ubuntu-latest
40-
needs: [signet-build, mainnet-build, ios-signet-build, ios-mainnet-build]
70+
needs: [signet-build, mainnet-build, ios-mainnet-archive]
4171
permissions:
4272
contents: write
4373
steps:
@@ -53,29 +83,13 @@ jobs:
5383
name: ${{ needs.mainnet-build.outputs.apk_artifact_name }}
5484
path: release-assets/mainnet-apk
5585

56-
- name: 📥 Download signet IPA artifact
57-
uses: actions/download-artifact@v8
58-
with:
59-
name: ${{ needs.ios-signet-build.outputs.artifact_name }}
60-
path: release-assets/signet-ipa
61-
62-
- name: 📥 Download mainnet IPA artifact
63-
uses: actions/download-artifact@v8
64-
with:
65-
name: ${{ needs.ios-mainnet-build.outputs.artifact_name }}
66-
path: release-assets/mainnet-ipa
67-
6886
- name: 📝 Prepare release assets
6987
run: |
7088
set -euo pipefail
7189
mv "release-assets/signet/${{ needs.signet-build.outputs.apk_filename }}" \
7290
release-assets/noah-signet.apk
7391
mv "release-assets/mainnet-apk/${{ needs.mainnet-build.outputs.apk_filename }}" \
7492
release-assets/noah-mainnet.apk
75-
mv "release-assets/signet-ipa/${{ needs.ios-signet-build.outputs.ipa_filename }}" \
76-
release-assets/noah-ios-signet.ipa
77-
mv "release-assets/mainnet-ipa/${{ needs.ios-mainnet-build.outputs.ipa_filename }}" \
78-
release-assets/noah-ios-mainnet.ipa
7993
8094
- name: 🚀 Create GitHub Release
8195
env:
@@ -87,8 +101,6 @@ jobs:
87101
gh release create "${GITHUB_REF_NAME}" \
88102
release-assets/noah-signet.apk \
89103
release-assets/noah-mainnet.apk \
90-
release-assets/noah-ios-signet.ipa \
91-
release-assets/noah-ios-mainnet.ipa \
92104
--repo "${{ github.repository }}" \
93105
--title "Noah ${release_version}" \
94106
--generate-notes

client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"build:ios:ci": "xcrun xcodebuild -scheme 'Noah-Regtest' -workspace 'ios/noah.xcworkspace' -configuration Release -sdk 'iphonesimulator' -destination 'generic/platform=iOS Simulator' -derivedDataPath ios/build -quiet ARCHS=arm64",
4242
"build:ios:mainnet:device": "xcrun xcodebuild -scheme 'Noah' -workspace 'ios/noah.xcworkspace' -configuration Release -sdk iphoneos -derivedDataPath ios/build -allowProvisioningUpdates build -quiet ARCHS=arm64",
4343
"build:ios:signet:device": "xcrun xcodebuild -scheme 'Noah-Signet' -workspace 'ios/noah.xcworkspace' -configuration Release -sdk iphoneos -derivedDataPath ios/build -allowProvisioningUpdates build -quiet ARCHS=arm64",
44+
"build:ios:mainnet:archive": "xcrun xcodebuild -scheme 'Noah' -workspace 'ios/noah.xcworkspace' -configuration Release -destination 'generic/platform=iOS' -derivedDataPath ios/build/DerivedData -archivePath ios/build/Noah-mainnet.xcarchive -allowProvisioningUpdates archive -quiet CODE_SIGN_STYLE=Automatic",
4445
"nitrogen": "bun --cwd nitromodules/noah-tools nitrogen",
4546
"format": "prettier --write .",
4647
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",

0 commit comments

Comments
 (0)