-
-
Notifications
You must be signed in to change notification settings - Fork 2
138 lines (129 loc) · 4.93 KB
/
push.yml
File metadata and controls
138 lines (129 loc) · 4.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Release
on:
push:
branches: [main]
jobs:
# lint code.
lint:
name: Lint
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# only lint on actual code changes.
- uses: dorny/paths-filter@v2
id: changes
with:
base: ${{ github.base_ref }}
filters: |
src:
- '**/*.swift'
- name: Lint
if: steps.changes.outputs.src == 'true'
run: |
set -o pipefail
swiftlint lint --strict --quiet | sed -E 's/^(.*):([0-9]+):([0-9]+): (warning|error|[^:]+): (.*)/::\4 title=Lint error,file=\1,line=\2,col=\3::\5\n\1:\2:\3/'
# build the library.
build:
name: Build
needs: lint
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# only build on actual code changes.
- uses: dorny/paths-filter@v2
id: changes
with:
base: ${{ github.event.push.before }}
filters: |
src:
- '**/*.swift'
- name: Build
if: steps.changes.outputs.src == 'true'
run: swift build
# release a new version.
release:
name: Release
needs: build
runs-on: ubuntu-latest
steps:
# checkout `main`.
- name: Checkout
id: checkout
uses: actions/checkout@v3
- name: Release version
id: release-version
uses: tomtom-international/commisery-action/bump@v1
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
ref: main
# create the changelog.
- name: Changelog
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
git-message: "chore(release): relase \'v{version}\'"
git-user-name: "github-actions"
git-user-email: "41898282+github-actions[bot]@users.noreply.github.com"
github-token: ${{ secrets.GITHUB_TOKEN }}
tag-prefix: ''
output-file: 'false'
skip-commit: 'true'
skip-version-file: 'true'
# release the new version.
- name: Release
id: release
uses: actions/create-release@v1
if: ${{ steps.changelog.outputs.skipped == 'false' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
release_name: v${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
# create docs.
docs:
name: Docs
needs: release
runs-on: ubuntu-latest
steps:
# checkout the `main` branch.
- name: Checkout
id: checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: main
# only push docs on actual code changes.
- uses: dorny/paths-filter@v2
id: changes
with:
base: ${{ github.event.push.before }}
filters: |
src:
- '**/*.swift'
- '**/push.yml'
# create documentation for `DropView`.
- name: Docs (DropView)
if: steps.changes.outputs.src == 'true'
uses: SwiftDocOrg/swift-doc@master
with:
base-url: "https://sbertix.github.io/DropView/DropView/"
format: "html"
inputs: "Sources"
module-name: DropView
output: docs/DropView
# update permissions.
- name: Update Permissions
if: steps.changes.outputs.src == 'true'
run: 'sudo chown --recursive $USER docs'
# publish to GitHub pages.
- name: Publish
if: steps.changes.outputs.src == 'true'
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.CHATOPS_PAT }}
BRANCH: gh-pages
FOLDER: docs