Skip to content
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

feat: Restructure for better support and maintenance #46

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions .circleci/config.yml

This file was deleted.

81 changes: 81 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Create release

on:
push:
branches: [main]

jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: macos-11.0

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Fetch all tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Bump version
run: |
chmod +x ./scripts/bump-version.sh
./scripts/bump-version.sh

# - name: Changelog
# uses: scottbrenner/generate-changelog-action@master
# id: Changelog
# env:
# REPO: ${{ github.repository }}

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}

- name: Restore SPM Cache
uses: actions/cache@v1
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-

- name: Release XCFrameworks
run: |
chmod +x ./scripts/xcframeworks.sh
./scripts/xcframeworks.sh

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: RxWebKit ${{ env.RELEASE_VERSION }}
# body: |
# ${{ steps.Changelog.outputs.changelog }}
draft: false
prerelease: false

- name: Upload XCFramework
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./RxWebKit.xcframework.zip
asset_name: RxWebKit.xcframework.zip
asset_content_type: application/zip

- name: Deploy to Cocoapods
run: |
set -eo pipefail
export RELEASE_VERSION="$(git describe --abbrev=0 | tr -d '\n')"
RELEASE_VERSION=${RELEASE_VERSION:1}
pod lib lint --allow-warnings
pod trunk push --allow-warnings
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Lint, build and test

on:
pull_request:
branches: [main]

jobs:
build:
runs-on: macos-11.0

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Fetch all tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Resolve dependencies
run: |
brew bundle
bundle

- name: Danger
run: |
bundle exec danger
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Restore SPM Cache
uses: actions/cache@v1
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-

- name: Build and test (SPM)
run: |
swift build
swift test

- name: Build Cocoapods iOS Demo
run: |
set -eo pipefail
cd Examples
xcodegen
pod install --repo-update
xcodebuild build -scheme 'RxWebKitDemo-iOS' -workspace 'RxWebKitDemo.xcworkspace' -sdk iphonesimulator -destination "platform=iOS simulator,name=iPhone 11"
32 changes: 8 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@

# Created by https://www.gitignore.io/api/swift

### Swift ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
Expand All @@ -20,6 +16,7 @@ DerivedData
*.perspectivev3
!default.perspectivev3
xcuserdata
*.swp

## Other
*.xccheckout
Expand All @@ -31,37 +28,24 @@ xcuserdata
*.hmap
*.ipa

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
Pods/

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
Carthage/Checkouts

Carthage/Build

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
# Swift Package Manager
.build
Package.resolved

fastlane/report.xml
fastlane/screenshots
.DS_Store
**/.idea/**
RxWebKit-SPM.xcodeproj
5 changes: 5 additions & 0 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
output: ../docs/RxWebKit
module: RxWebKit
xcodebuild_arguments:
- -scheme
- RxWebKit iOS
45 changes: 45 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
--allman false
--binarygrouping none
--commas inline
--comments ignore
--decimalgrouping 3,6
--elseposition same-line
--empty void
--exponentcase lowercase
--exponentgrouping disabled
--fractiongrouping disabled
--disable blankLinesAroundMark
--header ignore
--hexgrouping 4,8
--hexliteralcase uppercase
--patternlet hoist
--ifdef indent
--indent 2
--indentcase false
--linebreaks lf
--octalgrouping none
--operatorfunc nospace
--patternlet hoist
--ranges nospace
--self remove
--semicolons inline
--stripunusedargs closure-only
--trimwhitespace always
--wraparguments after-first
--wrapcollections before-first
--enable blankLinesBetweenScopes
--enable redundantVoidReturnType
--enable strongifiedSelf
--enable trailingClosures
--enable trailingSpace
--enable typeSugar
--enable spaceInsideParens
--enable spaceInsideBrackets
--enable spaceInsideBraces
--enable spaceAroundOperators
--enable spaceAroundBraces
--enable redundantParens
--enable redundantNilInit
--enable consecutiveSpaces
--enable anyObjectProtocol
--disable isEmpty
56 changes: 56 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
disabled_rules:
- trailing_whitespace
- trailing_comma
- large_tuple
- nesting
- todo
- operator_whitespace
- colon
- identifier_name

opt_in_rules: # some rules are only opt-in
- empty_count
- yoda_condition
# Find all the available rules by running:
# swiftlint rules

included:
- Sources
- Tests
- Examples/RxWebKitDemo-iOS

# excluded: # paths to ignore during linting. Takes precedence over `included`.

# configurable rules can be customized from this configuration file
# binary rules can set their severity level
force_cast: warning # implicitly
force_try:
severity: warning # explicitly
# rules that have both warning and error levels, can set just the warning level
# implicitly
line_length: 180
# they can set both implicitly with an array
function_body_length: 120
type_body_length:
- 400 # warning
- 500 # error
# or they can set both explicitly
file_length:
warning: 500
error: 1200
# naming rules can set warnings/errors for min_length and max_length
# additionally they can set excluded names
generic_type_name:
min_length: 1 # only warning
max_length: 30

type_name:
min_length: 2 # only warning
max_length: # warning and error
warning: 100
error: 120
excluded: iPhone # excluded via string
identifier_name:
min_length:
warning: 1
reporter: "xcode"

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .versionrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"releaseCommitMessageFormat": "chore(release): {{currentTag}} [skip ci]",
"compareUrlFormat": "{{host}}/{{owner}}/{{repository}}/branches/compare/{{currentTag}}%0D{{previousTag}}",
"commitUrlFormat": "{{host}}/{{owner}}/{{repository}}/commits/{{hash}}"
}
1 change: 1 addition & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
brew "xcodegen"
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "ReactiveX/RxSwift" ~> 5.0
github "ReactiveX/RxSwift" ~> 6.0
4 changes: 2 additions & 2 deletions Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "Quick/Quick"
github "Quick/Nimble"
github "Quick/Quick" ~> 3.0
github "Quick/Nimble" ~> 9.0
6 changes: 3 additions & 3 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "Quick/Nimble" "v8.0.7"
github "Quick/Quick" "v2.2.0"
github "ReactiveX/RxSwift" "5.1.1"
github "Quick/Nimble" "v9.0.0"
github "Quick/Quick" "v3.0.0"
github "ReactiveX/RxSwift" "6.0.0"
Loading