Skip to content

Commit fdd3b4e

Browse files
committed
Switching to GHA from Travis
Handles deploy hopefully, can’t test all of this flow without releasing… :-/
1 parent 67e588c commit fdd3b4e

13 files changed

+487
-331
lines changed

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
tidelift: "cocoapods/PromiseKit"
22
patreon: "mxcl"
3+
github: mxcl

.github/release

-17
This file was deleted.

.github/workflows/ci-exhaustive.yml

+185
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
name: CI (exhaustive)
2+
on:
3+
push:
4+
tags:
5+
- 'deploy/[0-9]+.[0-9]+.[0-9]+'
6+
jobs:
7+
auto-cancel:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: technote-space/auto-cancel-redundant-job@v1
11+
12+
build-linux-swift-3-2:
13+
needs: auto-cancel
14+
runs-on: ubuntu-16.04
15+
steps:
16+
- uses: fwal/setup-swift@v1
17+
with: {swift-version: 4.0.3}
18+
- uses: actions/checkout@v2
19+
- run: swift build -Xswiftc -warnings-as-errors -Xswiftc -swift-version -Xswiftc 3
20+
21+
build-linux-swift-3-3:
22+
needs: auto-cancel
23+
runs-on: ubuntu-16.04
24+
steps:
25+
- uses: fwal/setup-swift@v1
26+
with: {swift-version: 4.1.3}
27+
- uses: actions/checkout@v2
28+
- run: swift build -Xswiftc -warnings-as-errors -Xswiftc -swift-version -Xswiftc 3
29+
30+
build-linux-swift-3-4:
31+
needs: auto-cancel
32+
runs-on: ubuntu-16.04
33+
steps:
34+
- uses: fwal/setup-swift@v1
35+
with: {swift-version: 4.2.4}
36+
- uses: actions/checkout@v2
37+
- run: swift build -Xswiftc -warnings-as-errors -Xswiftc -swift-version -Xswiftc 3
38+
39+
build-linux-swift-4:
40+
needs: auto-cancel
41+
runs-on: ubuntu-16.04
42+
strategy:
43+
matrix:
44+
swift:
45+
- "4.0"
46+
- "4.1"
47+
- "4.2"
48+
steps:
49+
- uses: fwal/setup-swift@v1
50+
with:
51+
swift-version: ${{ matrix.swift }}
52+
- uses: actions/checkout@v2
53+
- run: swift build -Xswiftc -warnings-as-errors
54+
55+
build-linux-swift-5:
56+
needs: auto-cancel
57+
runs-on: ubuntu-18.04
58+
strategy:
59+
matrix:
60+
swift:
61+
- "5.0"
62+
- "5.1"
63+
- "5.2"
64+
- "5.3"
65+
- "5.4"
66+
steps:
67+
- uses: fwal/setup-swift@v1
68+
with:
69+
swift-version: ${{ matrix.swift }}
70+
- uses: actions/checkout@v2
71+
- run: swift build -Xswiftc -warnings-as-errors
72+
73+
test:
74+
needs: [build-linux-swift-5]
75+
runs-on: macos-latest
76+
strategy:
77+
matrix:
78+
dst:
79+
- platform=macOS
80+
- platform=tvOS Simulator,OS=14.3,name=Apple TV
81+
- platform=iOS Simulator,OS=14.4,name=iPhone 12
82+
steps:
83+
- uses: maxim-lobanov/setup-xcode@v1
84+
with:
85+
xcode-version: ^12
86+
- run: swift --version
87+
- uses: actions/checkout@v2
88+
- uses: sersoft-gmbh/xcodebuild-action@v1
89+
with:
90+
project: PromiseKit.xcodeproj
91+
scheme: PromiseKit
92+
destination: ${{ matrix.dst }}
93+
action: test
94+
enable-code-coverage: true
95+
- uses: codecov/codecov-action@v1
96+
97+
carthage:
98+
needs: auto-cancel
99+
runs-on: macos-latest
100+
steps:
101+
- run: swift --version
102+
- uses: actions/checkout@v2
103+
- run: carthage build --no-skip-current --configuration Release --use-xcframeworks
104+
105+
# Repeated ∵ GHA doesn’t support YAML anchors yet (or some kind of multi matrix)
106+
cocoapods-4-3:
107+
needs: build-linux-swift-4
108+
runs-on: macos-10.15
109+
steps:
110+
- uses: maxim-lobanov/setup-xcode@v1
111+
with: {xcode-version: 10.3}
112+
- uses: actions/checkout@v2
113+
- run: pod lib lint --subspec=PromiseKit/CorePromise --fail-fast --swift-version=4.3
114+
115+
cocoapods-5-0:
116+
needs: build-linux-swift-5
117+
runs-on: macos-10.15
118+
steps:
119+
- uses: maxim-lobanov/setup-xcode@v1
120+
with: {xcode-version: 10.3}
121+
- uses: actions/checkout@v2
122+
- run: pod lib lint --subspec=PromiseKit/CorePromise --fail-fast --swift-version=5.0
123+
124+
cocoapods-5-1:
125+
needs: build-linux-swift-5
126+
runs-on: macos-10.15
127+
steps:
128+
- uses: maxim-lobanov/setup-xcode@v1
129+
with: {xcode-version: 11.2}
130+
- uses: actions/checkout@v2
131+
- run: pod lib lint --subspec=PromiseKit/CorePromise --fail-fast --swift-version=5.1
132+
133+
cocoapods-5-2:
134+
needs: build-linux-swift-5
135+
runs-on: macos-10.15
136+
steps:
137+
- uses: maxim-lobanov/setup-xcode@v1
138+
with: {xcode-version: 11.7}
139+
- uses: actions/checkout@v2
140+
- run: pod lib lint --subspec=PromiseKit/CorePromise --fail-fast --swift-version=5.2
141+
142+
cocoapods-5-3:
143+
needs: build-linux-swift-5
144+
runs-on: macos-10.15
145+
steps:
146+
- uses: maxim-lobanov/setup-xcode@v1
147+
with: {xcode-version: 12.3}
148+
- uses: actions/checkout@v2
149+
- run: pod lib lint --subspec=PromiseKit/CorePromise --fail-fast --swift-version=5.3
150+
151+
cocoapods-5-4:
152+
needs: build-linux-swift-5
153+
runs-on: macos-10.15
154+
steps:
155+
- uses: maxim-lobanov/setup-xcode@v1
156+
with: {xcode-version: ^12}
157+
- uses: actions/checkout@v2
158+
- run: pod lib lint --subspec=PromiseKit/CorePromise --fail-fast --swift-version=5.4
159+
160+
create-release:
161+
runs-on: ubuntu-latest
162+
needs:
163+
- test
164+
- carthage
165+
- build-linux-swift-5
166+
- cocoapods-5-4
167+
steps:
168+
- uses: jungwinter/split@v1
169+
id: split
170+
with:
171+
seperator: '/' # this is correct, the action is typo’d despite warning
172+
msg: ${{ github.ref }}
173+
174+
- uses: actions/checkout@v2
175+
with:
176+
fetch-depth: 0 # zero means “all” (or push fails)
177+
178+
- name: Tag RC
179+
run: |
180+
git config user.name github-actions
181+
git config user.email [email protected]
182+
git tag rc/$v
183+
git push origin rc/$v
184+
env:
185+
v: ${{ steps.split.outputs._3 }}

.github/workflows/ci-shallow.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI (shallow)
2+
on:
3+
pull_request:
4+
paths-ignore:
5+
- README.md
6+
- .gitignore
7+
- Documentation/**
8+
jobs:
9+
auto-cancel:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: technote-space/auto-cancel-redundant-job@v1
13+
test-linux:
14+
needs: auto-cancel
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
# or fails due to some tests not being done for newer Swifts
19+
- run: find -name XCTestManifests.swift -o -name LinuxMain.swift | xargs rm
20+
- run: swift test -Xswiftc -warnings-as-errors
21+
test-macos:
22+
needs: auto-cancel
23+
runs-on: macos-latest
24+
steps:
25+
- uses: actions/checkout@v2
26+
- uses: sersoft-gmbh/xcodebuild-action@v1
27+
with:
28+
project: PromiseKit.xcodeproj
29+
scheme: PromiseKit
30+
destination: platform=macOS
31+
action: build
32+
build-settings: SWIFT_TREAT_WARNINGS_AS_ERRORS=YES
33+
- uses: sersoft-gmbh/xcodebuild-action@v1
34+
with:
35+
project: PromiseKit.xcodeproj
36+
scheme: PromiseKit
37+
destination: platform=macOS
38+
action: test

.github/workflows/post-publish.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# separate since this can be re-run without concern
2+
# stuff in publish should abort to allow re-tagging if it fails
3+
4+
name: Post-Publish
5+
on:
6+
release:
7+
types: [published]
8+
jobs:
9+
carthage:
10+
runs-on: macos-latest
11+
steps:
12+
- run: carthage build --no-skip-current --use-xcframeworks
13+
- run: carthage archive PromiseKit
14+
- run: mv PromiseKit.framework.zip PromiseKit-$v.framework.zip
15+
- uses: actions/upload-release-asset@v1
16+
with:
17+
upload_url: ${{ github.event.release.upload_url }}
18+
asset_path: ./PromiseKit-$v.framework.zip
19+
asset_name: PromiseKit-$v.framework.zip
20+
asset_content_type: application/zip
21+
env:
22+
v: ${{ github.event.release.tag_name }}
23+
GITHUB_TOKEN: ${{ github.token }}
24+
25+
docs:
26+
runs-on: macos-latest
27+
steps:
28+
- name: Start Deployment
29+
uses: bobheadxi/deployments@v1
30+
id: deployment
31+
with:
32+
step: start
33+
token: ${{ secrets.GITHUB_TOKEN }}
34+
env: docs
35+
- uses: actions/checkout@v2
36+
with:
37+
ref: gh-pages
38+
- run: |
39+
jazzy --config .github/jazzy.yml \
40+
--github_url 'https://github.com/mxcl/PromiseKit' \
41+
--module-version ${{ github.event.release.tag_name }}
42+
- run: git remote update
43+
- run: git checkout gh-pages
44+
- run: rm -rf reference/v6
45+
- run: mv output reference/v6
46+
- run: git add reference/v6
47+
- run: git config user.name Travis
48+
- run: git config user.email "[email protected]"
49+
- run: git commit -m 'Updated docs for v${{ github.event.release.tag_name }}'
50+
- run: git remote add secure-origin https://${{ JAZZY_PAT }}@github.com/mxcl/PromiseKit.git
51+
- run: git push secure-origin gh-pages
52+
- name: Seal Deployment
53+
uses: bobheadxi/deployments@v1
54+
if: always()
55+
with:
56+
step: finish
57+
token: ${{ secrets.GITHUB_TOKEN }}
58+
status: ${{ job.status }}
59+
deployment_id: ${{ steps.deployment.outputs.deployment_id }}

.github/workflows/pre-publish.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Pre-publish
2+
on:
3+
push:
4+
tags:
5+
- 'rc/[0-9]+.[0-9]+.[0-9]+'
6+
jobs:
7+
lint:
8+
runs-on: macos-latest
9+
steps:
10+
- run: pod lib lint
11+
create-release:
12+
runs-on: ubuntu-latest
13+
needs: lint
14+
steps:
15+
- uses: jungwinter/split@v1
16+
id: split
17+
with:
18+
seperator: '/' # this is correct, the action is typo’d despite warning
19+
msg: ${{ github.ref }}
20+
21+
- uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 0 # zero means “all” (or push fails)
24+
25+
- run: echo ${{ steps.split.outputs._3 }}
26+
27+
- name: Update committed versions
28+
run: |
29+
ruby -i -pe "sub(/CURRENT_PROJECT_VERSION = [0-9.]+/, 'CURRENT_PROJECT_VERSION = $v')" PromiseKit.xcodeproj/project.pbxproj
30+
ruby -i -pe "sub(/s.version = '[0-9.]+'/, 's.version = \"$v\"')" PromiseKit.podspec
31+
env:
32+
v: ${{ steps.split.outputs._3 }}
33+
- run: |
34+
! (git diff --quiet)
35+
- run: |
36+
git config user.name github-actions
37+
git config user.email [email protected]
38+
git commit -am "PromiseKit $v"
39+
git tag rc/$v/step-2
40+
git push origin rc/$v/step-2
41+
echo "SHA=$(git rev-parse --short rc/$v/step-2)" >> $GITHUB_ENV
42+
env:
43+
v: ${{ steps.split.outputs._3 }}
44+
45+
- uses: softprops/action-gh-release@v1
46+
id: release
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
with:
50+
tag_name: ${{ steps.split.outputs._3 }}
51+
name: ${{ steps.split.outputs._3 }}
52+
draft: true
53+
prerelease: true
54+
target_commitish: ${{ env.SHA }}

0 commit comments

Comments
 (0)