Skip to content

Commit a9fa631

Browse files
committed
feat: first commit
0 parents  commit a9fa631

File tree

76 files changed

+6833
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+6833
-0
lines changed

.github/ISSUE_TEMPLATE/config.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
contact_links:
2+
- name: Community Support
3+
url: https://github.com/CompileKernel/native-image-picker-macos/discussions/new?category=q-a
4+
about: Ask a question aboug using the plugin.

.github/workflows/changelog.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 📝 Changelog File Check
2+
3+
# This workflow only validates if the CHANGELOG.md file was updated and doesn't validate the format.
4+
5+
on:
6+
pull_request:
7+
types: [assigned, opened, synchronize, reopened, labeled, unlabeled]
8+
branches:
9+
- master
10+
11+
jobs:
12+
changelog:
13+
name: 🔍 Verify Changelog Modification
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: ✅ Check if CHANGELOG.md was modified
17+
uses: tarides/changelog-check-action@v2
18+
with:
19+
changelog: CHANGELOG.md

.github/workflows/checks.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: ✅ Code Quality Checks
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
checks:
11+
name: 🔍 Code Quality and Formatting Verification
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 10
14+
15+
steps:
16+
- name: 📥 Checkout Repository
17+
uses: actions/checkout@v4
18+
19+
- name: 🛠️ Setup Flutter (Stable)
20+
uses: subosito/flutter-action@v2
21+
with:
22+
channel: 'stable'
23+
cache: true
24+
25+
- name: 📦 Install Package Dependencies
26+
run: flutter pub get
27+
28+
- name: 📦 Install Example Project Dependencies
29+
run: flutter pub get -C example
30+
31+
- name: 🎨 Perform Flutter Analysis
32+
run: flutter analyze --write=flutter_analyze.log
33+
34+
- if: ${{ !cancelled() }}
35+
uses: yorifuji/flutter-analyze-commenter@v1
36+
with:
37+
analyze-log: flutter_analyze.log
38+
verbose: false
39+
40+
- name: 🔎 Validate Dart Code Formatting
41+
run: dart format --set-exit-if-changed .
42+
43+
- name: 🔄 Preview Potential Dart Fixes
44+
run: dart fix --dry-run
45+
46+
- name: 📦 Verify Package Readiness for Publishing
47+
run: flutter pub publish --dry-run

.github/workflows/publish.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: 🚀 Publish
2+
3+
on:
4+
push:
5+
tags: ['v[0-9]+.[0-9]+.[0-9]+']
6+
7+
jobs:
8+
publish:
9+
name: Publish to pub.dev
10+
permissions:
11+
id-token: write # Required for authentication using OIDC to publish to pub.dev
12+
contents: write # Required for creating a GitHub release and uploading the LICENSE file
13+
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
14+
github-release:
15+
name: Create GitHub Release
16+
needs: publish
17+
runs-on: ubuntu-latest
18+
steps:
19+
20+
- name: 📥 Checkout Repository
21+
uses: actions/checkout@v4
22+
23+
- name: 🏷️ Extract version from tag as pubspec.yaml version
24+
id: extract_version
25+
run: |
26+
version=$(echo ${GITHUB_REF} | sed 's/^refs\/tags\/v\(.*\)$/\1/')
27+
echo "VERSION=${version}" >> $GITHUB_OUTPUT
28+
29+
- name: 🔍 Validate extracted version format (should be pubspec.yaml valid version)
30+
run: |
31+
version=${{ steps.extract_version.outputs.VERSION }}
32+
if [[ ! $version =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then
33+
echo "❌ Invalid version format: $version. The version must be a valid pubspec.yaml version"
34+
exit 1
35+
fi
36+
37+
- name: ✂️ Extract Release Notes from CHANGELOG.md
38+
id: extract-release-notes
39+
uses: ffurrer2/extract-release-notes@v2
40+
with:
41+
changelog_file: CHANGELOG.md
42+
release_notes_file: RELEASE_NOTES.md
43+
44+
- name: 🚀 Create a GitHub Release
45+
uses: ncipollo/release-action@v1
46+
with:
47+
artifacts: "LICENSE"
48+
bodyFile: "RELEASE_NOTES.md"
49+
tag: ${{ github.ref_name }}
50+
prerelease: ${{ contains(github.ref_name, '-') }}
+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: ✅ Swift Formatting Check
2+
3+
# Separated from checks.yml since it takes longer to build swift-format from source.
4+
on:
5+
push:
6+
branches: [main]
7+
paths:
8+
- macos/native_image_picker_macos/**/*.swift
9+
- .github/workflows/swift-format-check.yml
10+
pull_request:
11+
paths:
12+
- macos/native_image_picker_macos/**/*.swift
13+
- .github/workflows/swift-format-check.yml
14+
15+
jobs:
16+
format-check:
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 10
19+
20+
env:
21+
SWIFT_FORMAT_VERSION: 600.0.0
22+
23+
steps:
24+
- name: 📥 Checkout Repository
25+
uses: actions/checkout@v4
26+
27+
- name: 🛠️ Setup Swift
28+
uses: swift-actions/setup-swift@v2
29+
30+
- name: 📦 Install Swift Format
31+
run: |
32+
git clone --branch $SWIFT_FORMAT_VERSION --depth 1 https://github.com/swiftlang/swift-format.git
33+
cd swift-format
34+
swift build -c release
35+
sudo mv .build/release/swift-format /usr/local/bin/
36+
37+
- name: 🔍 Verify Swift Format installation
38+
run: swift-format --version
39+
40+
- name: ℹ️ Print the default configuration
41+
run: swift-format dump-configuration
42+
43+
- name: 🔎 Validate Swift Code Formatting
44+
run: swift-format lint -r macos/native_image_picker_macos/Sources/native_image_picker_macos --strict
45+
46+
# SwiftLint: https://github.com/realm/SwiftLint
47+
# - name: 🎨 Verify Swift Code Style with SwiftLint
48+
# uses: norio-nomura/[email protected]

.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
26+
/pubspec.lock
27+
**/doc/api/
28+
.dart_tool/
29+
.flutter-plugins
30+
.flutter-plugins-dependencies
31+
build/
32+
33+
# Coverage
34+
coverage/

.metadata

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: "d14140f85439c517c98b0c40f8eaf942fcb46c74"
8+
channel: "main"
9+
10+
project_type: package

.pubignore

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
readme_assets/
2+
example/assets/
3+
4+
example/android/
5+
example/ios/
6+
example/macos/
7+
example/web/
8+
example/windows/
9+
example/linux/
10+
example/test_driver/
11+
example/integration_test/
12+
13+
test/
14+
.github/

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.0.1] - 2025-1-16
11+
12+
### Added
13+
14+
- Initial release.
15+
16+
[unreleased]: https://github.com/CompileKernel/native-image-picker-macos/compare/v0.0.1...HEAD
17+
[0.0.1]: https://github.com/CompileKernel/native-image-picker-macos/releases/tag/v0.0.1

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 CompileKernel and open source contributors.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)