Skip to content

Commit 174d0f6

Browse files
feat!: upgrade flow following modern SwiftUI (#11)
* feat: upgrade flow following modern SwiftUI BREAKING CHANGE: `Drop` is no longer supported. * chore(deps): bump actions/checkout from 2 to 3 (#9) Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump metcalfc/changelog-generator from 1.0.0 to 3.0.0 (#8) Bumps [metcalfc/changelog-generator](https://github.com/metcalfc/changelog-generator) from 1.0.0 to 3.0.0. - [Release notes](https://github.com/metcalfc/changelog-generator/releases) - [Changelog](https://github.com/metcalfc/changelog-generator/blob/main/release-notes.png) - [Commits](metcalfc/changelog-generator@v1.0.0...v3.0.0) --- updated-dependencies: - dependency-name: metcalfc/changelog-generator dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): update `commisery-action` location Closes #10 * chore(lint): simplify `.swiftlint.yml` * chore(actions): update PR flow Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent ea54edd commit 174d0f6

18 files changed

Lines changed: 856 additions & 736 deletions

‎.github/workflows/pull_request.yml‎

Lines changed: 12 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
name: pull_request
1+
name: Pull Request
22

3-
on: pull_request_target
3+
on:
4+
pull_request:
5+
branches: [main]
6+
types: [opened, synchronize, closed]
47

58
jobs:
69
# pull request-sepcific steps.
@@ -10,44 +13,11 @@ jobs:
1013

1114
steps:
1215
- name: Checkout
13-
uses: actions/checkout@v2
14-
with:
15-
token: ${{ secrets.GITHUB_TOKEN }}
16-
repository: ${{ github.event.pull_request_target.head.repo.full_name }}
17-
ref: ${{ github.event.pull_request_target.head.sha }}
16+
uses: actions/checkout@v3
1817
# validate commits.
1918
- name: Validate commits
20-
uses: KevinDeJong-TomTom/commisery-action@master
21-
with:
22-
token: ${{ secrets.GITHUB_TOKEN }}
23-
pull_request: ${{ github.event.number }}
24-
25-
# update the pull request message body.
26-
update_body:
27-
name: Changelog
28-
runs-on: ubuntu-latest
29-
30-
steps:
31-
- name: Checkout
32-
uses: actions/checkout@v2
33-
with:
34-
fetch-depth: 0
35-
token: ${{ secrets.GITHUB_TOKEN }}
36-
repository: ${{ github.event.pull_request_target.head.repo.full_name }}
37-
ref: ${{ github.event.pull_request_target.head.sha }}
38-
# create the changelog.
39-
- name: Changelog
40-
id: changelog
41-
uses: metcalfc/changelog-generator@v1.0.0
42-
with:
43-
mytoken: ${{ secrets.GITHUB_TOKEN }}
44-
head-ref: ${{ github.event.pull_request_target.head.sha }}
45-
base-ref: ${{ github.event.pull_request_target.base.sha }}
46-
# update the pull request message body.
47-
- name: Update Pull Request Description
48-
uses: riskledger/update-pr-description@v2
19+
uses: tomtom-international/commisery-action@master
4920
with:
50-
body: ${{ steps.changelog.outputs.changelog || steps.changelog.outputs.result }}
5121
token: ${{ secrets.GITHUB_TOKEN }}
5222

5323
# lint code.
@@ -57,22 +27,12 @@ jobs:
5727

5828
steps:
5929
- name: Checkout
60-
uses: actions/checkout@v2
61-
with:
62-
token: ${{ secrets.GITHUB_TOKEN }}
63-
repository: ${{ github.event.pull_request_target.head.repo.full_name }}
64-
ref: ${{ github.event.pull_request_target.head.sha }}
30+
uses: actions/checkout@v3
6531
# only lint on actual code changes.
66-
- uses: dorny/paths-filter@v2
67-
id: changes
68-
with:
69-
base: ${{ github.event.pull_request_target.base.sha }}
70-
filters: |
71-
src:
72-
- '**/*.swift'
7332
- name: Lint
74-
if: steps.changes.outputs.src == 'true'
7533
uses: norio-nomura/action-swiftlint@3.2.1
34+
env:
35+
DIFF_BASE: ${{ github.base_ref }}
7636
with:
7737
args: --strict
7838

@@ -84,16 +44,12 @@ jobs:
8444

8545
steps:
8646
- name: Checkout
87-
uses: actions/checkout@v2
88-
with:
89-
token: ${{ secrets.GITHUB_TOKEN }}
90-
repository: ${{ github.event.pull_request_target.head.repo.full_name }}
91-
ref: ${{ github.event.pull_request_target.head.sha }}
47+
uses: actions/checkout@v3
9248
# only build on actual code changes.
9349
- uses: dorny/paths-filter@v2
9450
id: changes
9551
with:
96-
base: ${{ github.event.pull_request_target.base.sha }}
52+
base: ${{ github.base_ref }}
9753
filters: |
9854
src:
9955
- '**/*.swift'

‎.github/workflows/push.yml‎

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,25 @@
1-
name: release
1+
name: Release
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [main]
76

87
jobs:
98
# lint code.
109
lint:
11-
name: Lint
12-
runs-on: ubuntu-latest
10+
name: Lint
11+
runs-on: ubuntu-latest
1312

1413
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v2
14+
- name: Checkout
15+
uses: actions/checkout@v3
1716
# only lint on actual code changes.
18-
- uses: dorny/paths-filter@v2
19-
id: changes
20-
with:
21-
base: ${{ github.event.push.before }}
22-
filters: |
23-
src:
24-
- '**/*.swift'
25-
- name: Lint
26-
if: steps.changes.outputs.src == 'true'
27-
uses: norio-nomura/action-swiftlint@3.2.1
17+
- name: Lint
18+
uses: norio-nomura/action-swiftlint@3.2.1
19+
env:
20+
DIFF_BASE: ${{ github.event.push.before }}
2821
with:
29-
args: --strict
22+
args: --strict
3023

3124
# build the library.
3225
build:
@@ -36,7 +29,7 @@ jobs:
3629

3730
steps:
3831
- name: Checkout
39-
uses: actions/checkout@v2
32+
uses: actions/checkout@v3
4033
# only build on actual code changes.
4134
- uses: dorny/paths-filter@v2
4235
id: changes
@@ -59,7 +52,7 @@ jobs:
5952
# checkout `main`.
6053
- name: Checkout
6154
id: checkout
62-
uses: actions/checkout@v2
55+
uses: actions/checkout@v3
6356
with:
6457
fetch-depth: 0
6558
token: ${{ secrets.GITHUB_TOKEN }}
@@ -99,7 +92,7 @@ jobs:
9992
# checkout the `main` branch.
10093
- name: Checkout
10194
id: checkout
102-
uses: actions/checkout@v2
95+
uses: actions/checkout@v3
10396
with:
10497
token: ${{ secrets.GITHUB_TOKEN }}
10598
ref: main

‎.swiftlint.yml‎

Lines changed: 1 addition & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,4 @@
1-
included:
2-
- Sources
3-
4-
opt_in_rules:
5-
- anyobject_protocol
6-
- array_init
7-
- attributes
8-
- class_delegate_protocol
9-
- closure_end_indentation
10-
- closure_spacing
11-
- collection_alignment
12-
- contains_over_filter_count
13-
- contains_over_filter_is_empty
14-
- contains_over_first_not_nil
15-
- contains_over_range_nil_comparison
16-
- convenience_type
17-
- discouraged_assert
18-
- empty_collection_literal
19-
- empty_count
20-
- empty_string
21-
- empty_xctest_method
22-
- enum_case_associated_values_count
23-
- expiring_todo
24-
- explicit_enum_raw_value
25-
- explicit_top_level_acl
26-
- extension_access_modifier
27-
- fallthrough
28-
- fatal_error_message
29-
- file_header
30-
- file_name_no_space
31-
- file_types_order
32-
- first_where
33-
- force_unwrapping
34-
- identical_operands
35-
- inert_defer
36-
- is_disjoint
37-
- joined_default_parameter
38-
- last_where
39-
- legacy_multiple
40-
- legacy_random
41-
- literal_expression_end_indentation
42-
- lower_acl_than_parent
43-
- missing_docs
44-
- modifier_order
45-
- multiline_arguments
46-
- multiline_function_chains
47-
- multiline_parameters
48-
- number_separator
49-
- operator_usage_whitespace
50-
- orphaned_doc_comment
51-
- pattern_matching_keywords
52-
- prefer_self_type_over_type_of_self
53-
- prefer_zero_over_explicit_init
54-
- private_subject
55-
- private_unit_test
56-
- prohibited_interface_builder
57-
- reduce_into
58-
- redundant_nil_coalescing
59-
- single_test_class
60-
- sorted_first_last
61-
- sorted_imports
62-
- static_operator
63-
- switch_case_on_newline
64-
- test_case_accessibility
65-
- toggle_bool
66-
- trailing_closure
67-
- type_contents_order
68-
- unavailable_function
69-
- unneeded_parentheses_in_closure_argument
70-
- unowned_variable_capture
71-
- untyped_error_in_catch
72-
- unused_import
73-
- vertical_parameter_alignment_on_call
74-
- vertical_whitespace_closing_braces
75-
- vertical_whitespace_opening_braces
76-
- yoda_condition
77-
78-
cyclomatic_complexity:
79-
ignores_case_statements: true
80-
81-
file_length:
82-
ignore_comment_only_lines: true
83-
84-
function_body_length:
85-
warning: 50
86-
871
identifier_name:
88-
excluded:
2+
excluded:
893
- x
904
- y
91-
- id
92-
- iv
93-
- url
94-
95-
line_length:
96-
ignores_comments: true
97-
ignores_function_declarations: true
98-
ignores_interpolated_strings: true
99-
ignores_urls: true

‎Package.swift‎

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,15 @@
1-
// swift-tools-version:5.3
2-
// The swift-tools-version declares the minimum version of Swift required to build this package.
1+
// swift-tools-version:5.7
32

43
import PackageDescription
54

65
let package = Package(
76
name: "DropView",
87
platforms: [
9-
.iOS(.v13),
8+
.iOS(.v14),
109
.macOS(.v11),
11-
.tvOS(.v13),
12-
.watchOS(.v6)
10+
.tvOS(.v14),
11+
.watchOS(.v7)
1312
],
14-
products: [
15-
// Products define the executables and libraries a package produces, and make them visible to other packages.
16-
.library(
17-
name: "DropView",
18-
targets: ["DropView"]),
19-
],
20-
dependencies: [
21-
// Dependencies declare other packages that this package depends on.
22-
// .package(url: /* package url */, from: "1.0.0"),
23-
],
24-
targets: [
25-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
26-
// Targets can depend on other targets in this package, and on products in packages this package depends on.
27-
.target(
28-
name: "DropView",
29-
dependencies: [])
30-
]
13+
products: [.library(name: "DropView", targets: ["DropView"])],
14+
targets: [.target(name: "DropView", dependencies: [])]
3115
)

‎Sources/DropView/Color.swift‎

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

0 commit comments

Comments
 (0)