Skip to content

Commit

Permalink
Initial transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
Seavenly committed Aug 31, 2023
0 parents commit 7e32fd4
Show file tree
Hide file tree
Showing 198 changed files with 9,592 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build
on: [pull_request, workflow_dispatch]

concurrency:
group: build-${{ github.event.number }}
cancel-in-progress: true

jobs:
cocoapods:
name: CocoaPods
runs-on: macos-latest
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Install Dependencies
run: bundle install

- name: Run pod lib lint
run: bundle exec fastlane build
20 changes: 20 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Linting
on: [pull_request, workflow_dispatch]

concurrency:
group: lint-${{ github.event.number }}
cancel-in-progress: true

jobs:
linting:
name: Linting
runs-on: macOS-latest
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Install Dependencies
run: bundle install

- name: Run Linting
run: bundle exec fastlane lint
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release
on:
workflow_dispatch: {}
push:
branches:
- release

jobs:
linting:
uses: paypal/paypal-messages-ios/.github/workflows/linting.yml@release

tests:
uses: paypal/paypal-messages-ios/.github/workflows/tests.yml@release

build:
uses: paypal/paypal-messages-ios/.github/workflows/build.yml@release

release:
name: Release
needs: [linting, tests, build]
runs-on: macos-latest

permissions:
contents: write
issues: write
pull-requests: write

steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
# pulls all commits (needed for semantic release to correctly version)
fetch-depth: '0'
persist-credentials: false

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "lts/*"

- name: Install Dependencies
run: |
bundle install
npm i -g @semantic-release/exec @semantic-release/changelog @semantic-release/git conventional-changelog-conventionalcommits@6.1.0
- name: GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release@21

- name: Publish to CocoaPods
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: bundle exec fastlane publish
20 changes: 20 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Tests
on: [pull_request, workflow_dispatch]

concurrency:
group: tests-${{ github.event.number }}
cancel-in-progress: true

jobs:
tests:
name: Tests
runs-on: macOS-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Dependencies
run: bundle install

- name: Run Unit Tests
run: bundle exec fastlane tests
45 changes: 45 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# OS X
.DS_Store

# Credentials
Demo/Demo/Credentials.plist
# Xcode
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
profile
*.moved-aside
DerivedData
*.xcscmblueprint
Archives

# Obj-C/Swift
*.hmap
*.ipa
*.dSYM.zip
*.dSYM

# CocoaPods
Pods

# Carthage
Carthage/

# SPM
.swiftpm
.build
SampleApps/SPMTest/SPMTest.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

# Fastlane
/fastlane/report.xml
/fastlane/coverage
/fastlane/test_output/

65 changes: 65 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"branches": ["main"],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"releaseRules": [
{ "type": "refactor", "release": "patch" },
{ "type": "perf", "release": "patch" },
{ "type": "style", "release": "patch" },
{ "type": "revert", "release": "patch" }
]
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{ "type": "feat", "section": "Features" },
{ "type": "fix", "section": "Bug Fixes" },
{ "type": "perf", "section": "Performance Improvements" },
{ "type": "revert", "section": "Reverts" },
{ "type": "docs", "section": "Documentation" },
{ "type": "style", "section": "Styles" },
{ "type": "chore", "section": "Miscellaneous Chores", "hidden": true },
{ "type": "refactor", "section": "Code Refactoring" },
{ "type": "test", "section": "Tests" },
{ "type": "build", "section": "Build System" },
{ "type": "ci", "section": "Continuous Integration" }
]
}
}
],
[
"@semantic-release/changelog",
{
"changelogTitle": "# Changelog"
}
],
[
"@semantic-release/exec",
{
"prepareCmd": "bundle exec fastlane release version:${nextRelease.version}",
"successCmd": "bundle exec fastlane sync"
}
],
[
"@semantic-release/git",
{
"assets": ["*"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
[
"@semantic-release/github",
{
"assets": "dist/*"
}
]
]
}

113 changes: 113 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Reference: https://github.com/realm/SwiftLint
# Required Swiftlint Version
# swiftlint_version: 0.39.2

# Paths to include in lint
included:
- Demo
- Sources
- Tests

disabled_rules:
- todo
- type_name # tests will have have the format <SUT>_Tests
- xctfail_message
- blanket_disable_command

opt_in_rules:
- array_init
- attributes
- closure_end_indentation
- closure_spacing
- collection_alignment
- colon # promote to error
- convenience_type
- discouraged_object_literal
- empty_collection_literal
- empty_count
- empty_string
- enum_case_associated_values_count
- fatal_error_message
- first_where
- force_unwrapping
- implicitly_unwrapped_optional
# - indentation_width
- last_where
- legacy_random
- literal_expression_end_indentation
- multiline_arguments
- multiline_function_chains
- multiline_literal_brackets
- multiline_parameters
- multiline_parameters_brackets
- operator_usage_whitespace
- overridden_super_call
- pattern_matching_keywords
- prefer_self_type_over_type_of_self
- redundant_nil_coalescing
- redundant_type_annotation
- strict_fileprivate
- toggle_bool
- trailing_closure
- unneeded_parentheses_in_closure_argument
- vertical_whitespace_closing_braces
- yoda_condition

analyzer_rules:
- unused_import

custom_rules:
array_constructor:
name: "Array/Dictionary initializer"
regex: '[let,var] .+ = (\[.+\]\(\))'
capture_group: 1
message: "Use explicit type annotation when initializing empty arrays and dictionaries"
severity: warning
space_after_main_type:
name: "No space after main type"
regex: '(class|struct|extension)((?-s)\s.*\{$\n)(?!^\s*$)'
message: "Empty line required after main declarations"
severity: warning

attributes:
always_on_same_line:
- "@IBSegueAction"
- "@IBAction"
- "@NSManaged"
- "@objc"

force_cast: warning
force_try: warning
function_body_length:
warning: 60

legacy_hashing: error

identifier_name:
excluded:
- i
- id
- x
- y
- z

# indentation_width:
# indentation_width: 4

line_length:
warning: 140
ignores_urls: true
ignores_comments: true

multiline_arguments:
first_argument_location: next_line
only_enforce_after_first_closure_on_first_line: true

private_over_fileprivate:
validate_extensions: true

trailing_whitespace:
ignores_empty_lines: true

vertical_whitespace:
max_empty_lines: 2
Loading

0 comments on commit 7e32fd4

Please sign in to comment.