-
Notifications
You must be signed in to change notification settings - Fork 2
Create Whole Project Structure #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
dcee162
chore: move all files to this repo
OS-ricardomoreirasilva b9c4d33
chore: add all workflows
OS-ricardomoreirasilva d7734ce
chore: add README
OS-ricardomoreirasilva 70ced82
fix: Fastfile configuration
OS-ricardomoreirasilva a359fe9
chore: remove setup java step
OS-ricardomoreirasilva f2f4c5f
fix: podspec file
OS-ricardomoreirasilva ac7d1e1
fix: README's plugin links
OS-ricardomoreirasilva 6cfe587
fix: move README's Quick Start section
OS-ricardomoreirasilva c8889d7
chore: add README version changes to bump_versions script
OS-ricardomoreirasilva 60ebbae
chore: add CHANGELOG entry
OS-ricardomoreirasilva 8dc2dce
chore: update Gemfile specs version
OS-ricardomoreirasilva f0e1bf1
chore: remove specific device from unit tests
OS-ricardomoreirasilva File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: Continuous Integration | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| jobs: | ||
| sonarcloud: | ||
| name: Unit-Tests | ||
| runs-on: macos-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Java 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'zulu' | ||
| java-version: '17' | ||
|
|
||
| - name: Link SwiftLint or install it | ||
| run: brew link --overwrite swiftlint || brew install swiftlint | ||
OS-pedrogustavobilro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Set up XCode | ||
| run: sudo xcode-select --switch /Applications/Xcode_15.0.app | ||
|
|
||
| - name: Bundle Install | ||
| run: bundle install | ||
|
|
||
| - name: Unit tests | ||
| run: bundle exec fastlane unit_tests | ||
|
|
||
| - name: Code Coverage | ||
| run: bundle exec fastlane coverage | ||
|
|
||
| - name: Lint | ||
| run: bundle exec fastlane lint | ||
OS-ricardomoreirasilva marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| name: Prepare Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| versionBumpLevel: | ||
| description: 'Version bump level (patch, minor, major)' | ||
| required: true | ||
| type: choice | ||
| default: 'patch' | ||
| options: | ||
| - patch | ||
| - minor | ||
| - major | ||
|
|
||
| jobs: | ||
| build-and-release: | ||
| if: github.ref == 'refs/heads/main' | ||
| runs-on: macos-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Link SwiftLint or install it | ||
| run: brew link --overwrite swiftlint || brew install swiftlint | ||
OS-pedrogustavobilro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Set up XCode | ||
| run: sudo xcode-select --switch /Applications/Xcode_15.0.app | ||
|
|
||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: '3.3' | ||
|
|
||
| - name: Bump version | ||
| run: ruby ./scripts/bump_versions.rb ${{ github.event.inputs.versionBumpLevel }} | ||
|
|
||
| - name: Build XCFramework | ||
| run: ./scripts/build_framework.sh | ||
|
|
||
| - name: Get new version | ||
| id: version | ||
| run: echo "VERSION=$(ruby -e 'puts File.read("./OSGeolocationLib.podspec").match(/spec.version.*=.*''(\d+\.\d+\.\d+)''/)[1]')" >> $GITHUB_ENV | ||
|
|
||
| - name: Create new branch | ||
| run: | | ||
| git switch --create "prepare-new-release-${{ env.VERSION }}" | ||
|
|
||
| - name: Move zip file to root and push changes | ||
| run: | | ||
| if [ -f OSGeolocationLib.zip ]; then | ||
| rm OSGeolocationLib.zip | ||
| else | ||
| echo "File does not exist." | ||
| fi | ||
| mv build/OSGeolocationLib.zip . | ||
| git config --global user.name 'github-actions[bot]' | ||
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
| git add . | ||
| git commit -m "chore: Bump version to ${{ env.VERSION }}" | ||
| git push origin HEAD:prepare-new-release-${{ env.VERSION }} | ||
|
|
||
| - name: Create pull request | ||
| id: create_pr | ||
| run: | | ||
| gh pr create -B main -H prepare-new-release-${{ env.VERSION }} --title 'Prepare `main` to Release `${{ env.VERSION }}`' --body 'Bumps version to `${{ env.VERSION }}`.<br/>Creates an updated and ready-to-be-released `OSGeolocationLib.zip`.' | ||
| PR_NUMBER=$(gh pr view --json number --jq '.number') | ||
| echo "PR_NUMBER=${PR_NUMBER}" >> $GITHUB_ENV | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Add label to the pull request | ||
| run: | | ||
| gh api \ | ||
| --method POST \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||
| /repos/${{ github.repository }}/issues/${{ env.PR_NUMBER }}/labels \ | ||
| -f "labels[]=release" | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: Release and Publish | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [closed] | ||
| branches: | ||
| - 'main' | ||
|
|
||
| jobs: | ||
| post-merge: | ||
| if: contains(github.event.pull_request.labels.*.name, 'release') && github.event.pull_request.merged == true | ||
| runs-on: macos-latest | ||
|
|
||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Cocoapods | ||
| run: gem install cocoapods | ||
|
|
||
| - name: Get new version | ||
| id: version | ||
| run: echo "VERSION=$(ruby -e 'puts File.read("./OSGeolocationLib.podspec").match(/spec.version.*=.*''(\d+\.\d+\.\d+)''/)[1]')" >> $GITHUB_ENV | ||
|
|
||
| - name: Extract release notes | ||
| run: sh scripts/extract_release_notes.sh "${{ env.VERSION }}" >> release_notes.md | ||
|
|
||
| - name: Create Tag | ||
| id: create_tag | ||
| run: | | ||
| # Define the tag name and message | ||
| TAG_NAME="${{ env.VERSION }}" | ||
| TAG_MESSAGE="Tag for version ${{ env.VERSION }}" | ||
|
|
||
| # Create the tag | ||
| git tag -a "$TAG_NAME" -m "$TAG_MESSAGE" | ||
| git push origin "$TAG_NAME" | ||
|
|
||
| echo "Tag created: $TAG_NAME" | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Create Release | ||
| run: | | ||
| # Extract the tag name | ||
| TAG_NAME="${{ env.VERSION }}" | ||
| RELEASE_NOTES="$(cat release_notes.md)" | ||
|
|
||
| # Create the release using GitHub CLI | ||
| gh release create "$TAG_NAME" \ | ||
| --title "$TAG_NAME" \ | ||
| --notes "$RELEASE_NOTES" \ | ||
| "OSGeolocationLib.zip" | ||
|
|
||
| echo "Release created for tag: $TAG_NAME" | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Deploy to Cocoapods | ||
| run: pod trunk push ./OSGeolocationLib.podspec --allow-warnings | ||
| env: | ||
| COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} | ||
|
|
||
| - name: Delete Release Branch | ||
| run: git push origin --delete prepare-new-release-${{ env.VERSION }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| disabled_rules: | ||
| - trailing_whitespace | ||
| - switch_case_alignment | ||
| opt_in_rules: | ||
| - empty_count | ||
| - empty_string | ||
| excluded: | ||
| - Carthage | ||
| - Pods | ||
| - vendor | ||
| - SwiftLint/Common/3rdPartyLib | ||
| line_length: | ||
| warning: 150 | ||
| error: 200 | ||
| ignores_function_declarations: true | ||
| ignores_comments: true | ||
| ignores_urls: true | ||
| function_body_length: | ||
| warning: 300 | ||
| error: 500 | ||
| function_parameter_count: | ||
| warning: 6 | ||
| error: 8 | ||
| type_body_length: | ||
| warning: 300 | ||
| error: 500 | ||
| file_length: | ||
| warning: 1000 | ||
| error: 1500 | ||
| ignore_comment_only_lines: true | ||
| cyclomatic_complexity: | ||
| warning: 15 | ||
| error: 25 | ||
| reporter: "xcode" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Changelog | ||
OS-ricardomoreirasilva marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| All notable changes to this project will be documented in this file. | ||
|
|
||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| source "https://rubygems.org" | ||
|
|
||
| gem "fastlane" | ||
| gem "slather" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.