Skip to content

Commit a6905ad

Browse files
committed
chore: migrate to SPM, remove CocoaPods and hotkey_manager dependency
- Remove CocoaPods from macOS example project (pod deintegrate, delete Podfile/Podfile.lock) - Remove hotkey_manager dependency and its usage from example app - Migrate CI workflows (merge build/lint/test into ci.yml, add publish.yml) - Ignore SPM .build artifacts in .gitignore
1 parent 29afbbb commit a6905ad

24 files changed

Lines changed: 361 additions & 388 deletions

File tree

.github/workflows/build.yml

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

.github/workflows/ci.yml

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
name: Lint & Analyze
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Flutter
19+
uses: subosito/flutter-action@v2
20+
with:
21+
flutter-version: '3.38.7'
22+
channel: 'stable'
23+
cache: true
24+
25+
- name: Install melos
26+
run: dart pub global activate melos
27+
28+
- name: Add melos to PATH
29+
run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
30+
31+
- name: Verify melos installation
32+
run: dart pub global run melos --version
33+
34+
- name: Bootstrap melos
35+
run: dart pub global run melos bootstrap
36+
37+
- name: Check code formatting
38+
run: dart pub global run melos run format-check
39+
40+
- name: Analyze code
41+
run: dart pub global run melos run analyze
42+
43+
test:
44+
name: Test (${{ matrix.os }})
45+
runs-on: ${{ matrix.os }}
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
os: [ubuntu-latest, macos-latest, windows-latest]
50+
51+
steps:
52+
- name: Checkout repository
53+
uses: actions/checkout@v4
54+
55+
- name: Setup Flutter
56+
uses: subosito/flutter-action@v2
57+
with:
58+
flutter-version: '3.38.7'
59+
channel: 'stable'
60+
cache: true
61+
62+
- name: Install melos
63+
run: dart pub global activate melos
64+
65+
- name: Add melos to PATH
66+
shell: bash
67+
run: |
68+
if [[ "$RUNNER_OS" == "Windows" ]]; then
69+
echo "$USERPROFILE/.pub-cache/bin" >> $GITHUB_PATH
70+
else
71+
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
72+
fi
73+
74+
- name: Verify melos installation
75+
run: dart pub global run melos --version
76+
77+
- name: Bootstrap melos
78+
run: dart pub global run melos bootstrap
79+
80+
- name: Run tests
81+
run: dart pub global run melos run test
82+
83+
# Linux build
84+
build-linux:
85+
name: Build Linux
86+
runs-on: ubuntu-latest
87+
needs: [lint]
88+
89+
steps:
90+
- name: Checkout repository
91+
uses: actions/checkout@v4
92+
93+
- name: Setup Flutter
94+
uses: subosito/flutter-action@v2
95+
with:
96+
flutter-version: '3.38.7'
97+
channel: 'stable'
98+
cache: true
99+
100+
- name: Install melos
101+
run: dart pub global activate melos
102+
103+
- name: Add melos to PATH
104+
run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
105+
106+
- name: Bootstrap melos
107+
run: dart pub global run melos bootstrap
108+
109+
- name: Install Linux dependencies
110+
run: |
111+
sudo apt-get update
112+
sudo apt-get install -y \
113+
clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
114+
115+
- name: Build screen_retriever example Linux
116+
run: |
117+
cd packages/screen_retriever/example
118+
flutter build linux --release
119+
120+
# macOS build
121+
build-macos:
122+
name: Build macOS
123+
runs-on: macos-latest
124+
needs: [lint]
125+
126+
steps:
127+
- name: Checkout repository
128+
uses: actions/checkout@v4
129+
130+
- name: Setup Flutter
131+
uses: subosito/flutter-action@v2
132+
with:
133+
flutter-version: '3.38.7'
134+
channel: 'stable'
135+
cache: true
136+
137+
- name: Install melos
138+
run: dart pub global activate melos
139+
140+
- name: Add melos to PATH
141+
run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
142+
143+
- name: Bootstrap melos
144+
run: dart pub global run melos bootstrap
145+
146+
- name: Build screen_retriever example macOS
147+
run: |
148+
cd packages/screen_retriever/example
149+
flutter build macos --release
150+
151+
# Windows build
152+
build-windows:
153+
name: Build Windows
154+
runs-on: windows-latest
155+
needs: [lint]
156+
157+
steps:
158+
- name: Checkout repository
159+
uses: actions/checkout@v4
160+
161+
- name: Setup Flutter
162+
uses: subosito/flutter-action@v2
163+
with:
164+
flutter-version: '3.38.7'
165+
channel: 'stable'
166+
cache: true
167+
168+
- name: Install melos
169+
run: dart pub global activate melos
170+
171+
- name: Add melos to PATH
172+
shell: bash
173+
run: echo "$USERPROFILE/.pub-cache/bin" >> $GITHUB_PATH
174+
175+
- name: Bootstrap melos
176+
run: dart pub global run melos bootstrap
177+
178+
- name: Build screen_retriever example Windows
179+
run: |
180+
cd packages/screen_retriever/example
181+
flutter build windows --release

.github/workflows/lint.yml

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

.github/workflows/publish.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Publish to pub.dev
2+
3+
on:
4+
push:
5+
tags:
6+
- "v[0-9]+.[0-9]+.[0-9]+*"
7+
8+
jobs:
9+
publish:
10+
name: Publish to pub.dev
11+
permissions:
12+
id-token: write # Required for requesting the JWT
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
# Set up the Dart SDK and provision the OIDC token used for publishing.
19+
- uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260
20+
21+
# Download Flutter SDK - needed for publishing Flutter packages.
22+
- uses: flutter-actions/setup-flutter@18c66a64fb6f6d3338c63cabbc5cd6da395e7f1d
23+
24+
# Publish screen_retriever_platform_interface (no package dependencies)
25+
- name: Install dependencies (screen_retriever_platform_interface)
26+
run: dart pub get
27+
working-directory: packages/screen_retriever_platform_interface
28+
29+
- name: Publish - dry run (screen_retriever_platform_interface)
30+
run: dart pub publish --dry-run
31+
working-directory: packages/screen_retriever_platform_interface
32+
33+
- name: Publish screen_retriever_platform_interface
34+
run: dart pub publish -f
35+
working-directory: packages/screen_retriever_platform_interface
36+
37+
# Publish screen_retriever_linux
38+
- name: Install dependencies (screen_retriever_linux)
39+
run: dart pub get
40+
working-directory: packages/screen_retriever_linux
41+
42+
- name: Publish - dry run (screen_retriever_linux)
43+
run: dart pub publish --dry-run
44+
working-directory: packages/screen_retriever_linux
45+
46+
- name: Publish screen_retriever_linux
47+
run: dart pub publish -f
48+
working-directory: packages/screen_retriever_linux
49+
50+
# Publish screen_retriever_macos
51+
- name: Install dependencies (screen_retriever_macos)
52+
run: dart pub get
53+
working-directory: packages/screen_retriever_macos
54+
55+
- name: Publish - dry run (screen_retriever_macos)
56+
run: dart pub publish --dry-run
57+
working-directory: packages/screen_retriever_macos
58+
59+
- name: Publish screen_retriever_macos
60+
run: dart pub publish -f
61+
working-directory: packages/screen_retriever_macos
62+
63+
# Publish screen_retriever_windows
64+
- name: Install dependencies (screen_retriever_windows)
65+
run: dart pub get
66+
working-directory: packages/screen_retriever_windows
67+
68+
- name: Publish - dry run (screen_retriever_windows)
69+
run: dart pub publish --dry-run
70+
working-directory: packages/screen_retriever_windows
71+
72+
- name: Publish screen_retriever_windows
73+
run: dart pub publish -f
74+
working-directory: packages/screen_retriever_windows
75+
76+
# Publish screen_retriever (main federated plugin)
77+
- name: Install dependencies (screen_retriever)
78+
run: dart pub get
79+
working-directory: packages/screen_retriever
80+
81+
- name: Publish - dry run (screen_retriever)
82+
run: dart pub publish --dry-run
83+
working-directory: packages/screen_retriever
84+
85+
- name: Publish screen_retriever
86+
run: dart pub publish -f
87+
working-directory: packages/screen_retriever

.github/workflows/test.yml

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

packages/screen_retriever/example/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*.swp
66
.DS_Store
77
.atom/
8+
.build/
89
.buildlog/
910
.history
1011
.svn/
12+
.swiftpm/
1113
migrate_working_dir/
1214

1315
# IntelliJ related

0 commit comments

Comments
 (0)