Skip to content

Commit 4395450

Browse files
[CI] Get rid of mint package manager (#946)
1 parent e37dc22 commit 4395450

File tree

12 files changed

+49
-38
lines changed

12 files changed

+49
-38
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
@@ -80,7 +80,7 @@ jobs:
8080
INSTALL_VIDEO_BUDDY: true
8181
INSTALL_YEETD: true
8282
INSTALL_IPSW: true
83-
SKIP_MINT_BOOTSTRAP: true
83+
SKIP_SWIFT_BOOTSTRAP: true
8484
- uses: ./.github/actions/setup-ios-runtime
8585
if: ${{ matrix.setup_runtime }}
8686
timeout-minutes: 60

.github/workflows/smoke-checks.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
- uses: ./.github/actions/bootstrap
8989
env:
9090
INSTALL_YEETD: true
91-
SKIP_MINT_BOOTSTRAP: true
91+
SKIP_SWIFT_BOOTSTRAP: true
9292
- name: Run UI Tests (Debug)
9393
run: bundle exec fastlane test_swiftui device:"${{ env.IOS_SIMULATOR_DEVICE }}" record:"${{ github.event.inputs.record_snapshots_swiftui }}"
9494
timeout-minutes: 120
@@ -114,7 +114,7 @@ jobs:
114114
- uses: ./.github/actions/bootstrap
115115
env:
116116
INSTALL_YEETD: true
117-
SKIP_MINT_BOOTSTRAP: true
117+
SKIP_SWIFT_BOOTSTRAP: true
118118
- name: Run UI Tests (Debug)
119119
run: bundle exec fastlane test_uikit device:"${{ env.IOS_SIMULATOR_DEVICE }}" record:"${{ github.event.inputs.record_snapshots_uikit }}"
120120
timeout-minutes: 120
@@ -263,7 +263,7 @@ jobs:
263263
INSTALL_ALLURE: true
264264
INSTALL_VIDEO_BUDDY: true
265265
INSTALL_YEETD: true
266-
SKIP_MINT_BOOTSTRAP: true
266+
SKIP_SWIFT_BOOTSTRAP: true
267267
- name: Run UI Tests (Debug)
268268
run: bundle exec fastlane test_e2e device:"${{ env.IOS_SIMULATOR_DEVICE }}" batch:'${{ matrix.batch }}' test_without_building:true
269269
timeout-minutes: 60

.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

Githubfile

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

Mintfile

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

Scripts/bootstrap.sh

Lines changed: 33 additions & 11 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

Scripts/generate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ rm -rf ./Sources/StreamVideo/OpenApi/generated/Models/*
2121
)
2222

2323
# format the generated code
24-
mint run swiftformat Sources/StreamVideo/OpenApi/generated
24+
swiftformat Sources/StreamVideo/OpenApi/generated

StreamVideo.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8077,7 +8077,7 @@
80778077
);
80788078
runOnlyForDeploymentPostprocessing = 0;
80798079
shellPath = /bin/sh;
8080-
shellScript = "#!/bin/sh\n# Add Homebrew paths for both Intel and Apple Silicon Macs\nexport PATH=\"/opt/homebrew/bin:/usr/local/bin:$PATH\"\n\necho \"SwiftGen Build Phase: Starting at $(date)\"\necho \"PATH: $PATH\"\n\nif which mint >/dev/null && mint which swiftgen >/dev/null 2>&1; then\n echo \"Running SwiftGen...\"\n echo \"Mint found at: $(which mint)\"\n echo \"SwiftGen found at: $(mint which swiftgen)\"\n xcrun --sdk macosx mint run swiftgen config run --config \"${SRCROOT}/Sources/StreamVideoSwiftUI/.swiftgen.yml\"\n echo \"SwiftGen completed with exit code: $?\"\nelse\n echo \"Warning: Bootstrap not run, please run ./Scripts/bootstrap.sh\"\n echo \"Mint path: $(which mint || echo 'not found')\"\n echo \"Current PATH: $PATH\"\n exit 0\nfi\n";
8080+
shellScript = "#!/bin/sh\n# Add Homebrew paths for both Intel and Apple Silicon Macs\nexport PATH=\"/opt/homebrew/bin:/usr/local/bin:$PATH\"\n\necho \"SwiftGen Build Phase: Starting at $(date)\"\necho \"PATH: $PATH\"\n\nif which swiftgen >/dev/null 2>&1; then\n echo \"Running SwiftGen...\"\n echo \"SwiftGen found at: $(which swiftgen)\"\n xcrun --sdk macosx swiftgen config run --config \"${SRCROOT}/Sources/StreamVideoSwiftUI/.swiftgen.yml\"\n echo \"SwiftGen completed with exit code: $?\"\nelse\n echo \"Warning: Bootstrap not run, please run ./Scripts/bootstrap.sh\"\n echo \"Current PATH: $PATH\"\n exit 0\nfi\n";
80818081
};
80828082
/* End PBXShellScriptBuildPhase section */
80838083

0 commit comments

Comments
 (0)