Skip to content

Commit 3a7d104

Browse files
[CI] Get rid of mint package manager (#3816)
1 parent b9415ae commit 3a7d104

File tree

12 files changed

+50
-39
lines changed

12 files changed

+50
-39
lines changed

.github/actions/bootstrap/action.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,6 @@ runs:
55
steps:
66
- run: echo "IMAGE=${ImageOS}" >> $GITHUB_ENV
77
shell: bash
8-
- run: echo "$HOME/.mint/bin" >> $GITHUB_PATH
9-
shell: bash
10-
- name: Cache Mint
11-
uses: actions/cache@v4
12-
id: mint-cache
13-
with:
14-
path: ~/.mint
15-
key: ${{ env.IMAGE }}-mint-${{ hashFiles('**/Mintfile') }}
16-
restore-keys: ${{ env.IMAGE }}-mint-
178
- uses: ./.github/actions/ruby-cache
189
- uses: ./.github/actions/xcode-cache
1910
- run: ./Scripts/bootstrap.sh

.github/actions/xcode-cache/action.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ runs:
55
steps:
66
- run: echo "IMAGE=${ImageOS}-${ImageVersion}" >> $GITHUB_ENV
77
shell: bash
8-
- run: echo "$HOME/.mint/bin" >> $GITHUB_PATH
9-
shell: bash
108
- name: Cache SPM
119
uses: actions/cache@v4
1210
id: spm-cache

.github/workflows/cron-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
INSTALL_ALLURE: true
5757
INSTALL_YEETD: true
5858
INSTALL_IPSW: true
59-
SKIP_MINT_BOOTSTRAP: true
59+
SKIP_SWIFT_BOOTSTRAP: true
6060
- uses: ./.github/actions/setup-ios-runtime
6161
if: ${{ matrix.setup_runtime }}
6262
timeout-minutes: 60

.github/workflows/smoke-checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ jobs:
132132
- uses: ./.github/actions/bootstrap
133133
env:
134134
INSTALL_YEETD: true
135-
SKIP_MINT_BOOTSTRAP: true
135+
SKIP_SWIFT_BOOTSTRAP: true
136136
- name: Run UI Tests (Debug)
137137
run: bundle exec fastlane test_ui device:"${{ env.IOS_SIMULATOR_DEVICE }}" skip_build:true record:"${{ github.event.inputs.record_snapshots }}"
138138
timeout-minutes: 120
@@ -193,7 +193,7 @@ jobs:
193193
env:
194194
INSTALL_ALLURE: true
195195
INSTALL_YEETD: true
196-
SKIP_MINT_BOOTSTRAP: true
196+
SKIP_SWIFT_BOOTSTRAP: true
197197
- name: Run UI Tests (Debug)
198198
run: bundle exec fastlane test_e2e_mock device:"${{ env.IOS_SIMULATOR_DEVICE }}" batch:'${{ matrix.batch }}' test_without_building:true
199199
timeout-minutes: 100

.github/workflows/sonar.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- uses: ./.github/actions/bootstrap
2222
env:
2323
INSTALL_SONAR: true
24-
SKIP_MINT_BOOTSTRAP: true
24+
SKIP_SWIFT_BOOTSTRAP: true
2525

2626
- uses: actions/github-script@v6
2727
id: get_pr_number

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Agents should prioritize backwards compatibility, API stability, and high test c
1414
• Minimum Xcode: 15.x or newer (Apple Silicon supported)
1515
• iOS targets: Follow existing deployment targets in package/podspec files; don’t lower without approval
1616
• CI: GitHub Actions (assume PR validation on build + tests + lint)
17-
• Linters & docs: SwiftLint (via Mint)
17+
• Linters & docs: SwiftLint and SwiftFormat
1818

1919
### Project layout (high level)
2020

Githubfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ export MINT_VERSION='0.17.5'
88
export SONAR_VERSION='6.2.1.4610'
99
export IPSW_VERSION='3.1.592'
1010
export INTERFACE_ANALYZER_VERSION='1.0.7'
11+
export SWIFT_LINT_VERSION='0.52.4'
12+
export SWIFT_FORMAT_VERSION='0.47.12'
13+
export SWIFT_GEN_VERSION='6.5.1'

Mintfile

Lines changed: 0 additions & 3 deletions
This file was deleted.

Scripts/bootstrap.sh

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# shellcheck source=/dev/null
33
# Usage: ./bootstrap.sh
44
# This script will:
5-
# - install Mint and bootstrap its dependencies
5+
# - install SwiftLint, SwiftFormat, SwiftGen
66
# - link git hooks
77
# - install allure dependencies if `INSTALL_ALLURE` environment variable is provided
88
# - install sonar-scanner if `INSTALL_SONAR` environment variable is provided
@@ -26,19 +26,41 @@ if [ "${GITHUB_ACTIONS:-}" != "true" ]; then
2626
bundle exec lefthook install
2727
fi
2828

29-
if [ "${SKIP_MINT_BOOTSTRAP:-}" != true ]; then
30-
puts "Bootstrap Mint dependencies"
31-
git clone https://github.com/yonaskolb/Mint.git fastlane/mint
32-
root=$(pwd)
33-
cd fastlane/mint
34-
swift run mint install "yonaskolb/mint@${MINT_VERSION}"
35-
cd $root
36-
rm -rf fastlane/mint
37-
mint bootstrap --link
29+
if [ "${SKIP_SWIFT_BOOTSTRAP:-}" != true ]; then
30+
puts "Install SwiftLint v${SWIFT_LINT_VERSION}"
31+
DOWNLOAD_URL="https://github.com/realm/SwiftLint/releases/download/${SWIFT_LINT_VERSION}/SwiftLint.pkg"
32+
DOWNLOAD_PATH="/tmp/SwiftLint-${SWIFT_LINT_VERSION}.pkg"
33+
curl -sL "$DOWNLOAD_URL" -o "$DOWNLOAD_PATH"
34+
sudo installer -pkg "$DOWNLOAD_PATH" -target /
35+
swiftlint version
36+
37+
puts "Install SwiftFormat v${SWIFT_FORMAT_VERSION}"
38+
DOWNLOAD_URL="https://github.com/nicklockwood/SwiftFormat/releases/download/${SWIFT_FORMAT_VERSION}/swiftformat.zip"
39+
DOWNLOAD_PATH="/tmp/swiftformat-${SWIFT_FORMAT_VERSION}.zip"
40+
BIN_PATH="/usr/local/bin/swiftformat"
41+
brew uninstall swiftformat || true
42+
curl -sL "$DOWNLOAD_URL" -o "$DOWNLOAD_PATH"
43+
unzip -o "$DOWNLOAD_PATH" -d /tmp/swiftformat-${SWIFT_FORMAT_VERSION}
44+
sudo mv /tmp/swiftformat-${SWIFT_FORMAT_VERSION}/swiftformat "$BIN_PATH"
45+
sudo chmod +x "$BIN_PATH"
46+
swiftformat --version
47+
48+
puts "Install SwiftGen v${SWIFT_GEN_VERSION}"
49+
DOWNLOAD_URL="https://github.com/SwiftGen/SwiftGen/releases/download/${SWIFT_GEN_VERSION}/swiftgen-${SWIFT_GEN_VERSION}.zip"
50+
DOWNLOAD_PATH="/tmp/swiftgen-${SWIFT_GEN_VERSION}.zip"
51+
INSTALL_DIR="/usr/local/lib/swiftgen"
52+
BIN_PATH="/usr/local/bin/swiftgen"
53+
curl -sL "$DOWNLOAD_URL" -o "$DOWNLOAD_PATH"
54+
sudo rm -rf "$INSTALL_DIR"
55+
sudo mkdir -p "$INSTALL_DIR"
56+
sudo unzip -o "$DOWNLOAD_PATH" -d "$INSTALL_DIR"
57+
sudo sudo rm -f "$BIN_PATH"
58+
sudo sudo ln -s "$INSTALL_DIR/bin/swiftgen" "$BIN_PATH"
59+
swiftgen --version
3860
fi
3961

4062
if [[ ${INSTALL_SONAR-default} == true ]]; then
41-
puts "Install sonar scanner"
63+
puts "Install sonar scanner v${SONAR_VERSION}"
4264
DOWNLOAD_URL="https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_VERSION}-macosx-x64.zip"
4365
curl -sL "${DOWNLOAD_URL}" -o ./fastlane/sonar.zip
4466
cd fastlane
@@ -54,12 +76,12 @@ puts "Adding DemoApp-StreamDevelopers.xcscheme to the Xcode project"
5476
cp Scripts/DemoApp-StreamDevelopers.xcscheme StreamChat.xcodeproj/xcshareddata/xcschemes/DemoApp-StreamDevelopers.xcscheme
5577

5678
if [[ ${INSTALL_ALLURE-default} == true ]]; then
57-
puts "Install allurectl"
79+
puts "Install allurectl v${ALLURECTL_VERSION}"
5880
DOWNLOAD_URL="https://github.com/allure-framework/allurectl/releases/download/${ALLURECTL_VERSION}/allurectl_darwin_amd64"
5981
curl -sL "${DOWNLOAD_URL}" -o ./fastlane/allurectl
6082
chmod +x ./fastlane/allurectl
6183

62-
puts "Install xcresults"
84+
puts "Install xcresults v${XCRESULTS_VERSION}"
6385
DOWNLOAD_URL="https://github.com/eroshenkoam/xcresults/releases/download/${XCRESULTS_VERSION}/xcresults"
6486
curl -sL "${DOWNLOAD_URL}" -o ./fastlane/xcresults
6587
chmod +x ./fastlane/xcresults

StreamChat.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10732,7 +10732,7 @@
1073210732
);
1073310733
runOnlyForDeploymentPostprocessing = 0;
1073410734
shellPath = /bin/sh;
10735-
shellScript = "# Adds support for Apple Silicon brew directory\nexport PATH=\"$PATH:/opt/homebrew/bin\"\n\nif which mint >/dev/null && mint which swiftgen; then\n xcrun --sdk macosx mint run swiftgen config run --config ./Sources/StreamChatUI/.swiftgen.yml\nelse\n echo \"Warning: Bootstrap not run, please run ./bootstrap.sh\"\nfi\n";
10735+
shellScript = "# Adds support for Apple Silicon brew directory\nexport PATH=\"$PATH:/opt/homebrew/bin\"\n\nif which swiftgen; then\n xcrun --sdk macosx swiftgen config run --config ./Sources/StreamChatUI/.swiftgen.yml\nelse\n echo \"Warning: Bootstrap not run, please run ./bootstrap.sh\"\nfi\n";
1073610736
};
1073710737
/* End PBXShellScriptBuildPhase section */
1073810738

0 commit comments

Comments
 (0)