Skip to content

Commit 0122f95

Browse files
committed
Probs the way to do this
1 parent cf94b87 commit 0122f95

File tree

4 files changed

+139
-143
lines changed

4 files changed

+139
-143
lines changed

.github/workflows/cd.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: CD
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
required: true
7+
jobs:
8+
pods:
9+
runs-on: macos-latest
10+
steps:
11+
12+
- name: Start Deployment
13+
uses: bobheadxi/[email protected]
14+
id: deployment
15+
with:
16+
step: start
17+
token: ${{ secrets.GITHUB_TOKEN }}
18+
env: pods
19+
20+
- uses: actions/checkout@v2
21+
with:
22+
submodules: true
23+
24+
- run: pod trunk push --allow-warnings --skip-tests --skip-import-validation
25+
env:
26+
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
27+
28+
- name: Seal Deployment
29+
uses: bobheadxi/[email protected]
30+
if: always()
31+
with:
32+
step: finish
33+
token: ${{ secrets.GITHUB_TOKEN }}
34+
status: ${{ job.status }}
35+
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
36+
37+
# fails: https://github.com/Carthage/Carthage/issues/3130
38+
# carthage:
39+
# runs-on: macos-latest
40+
# steps:
41+
42+
# - name: Start Deployment
43+
# uses: bobheadxi/[email protected]
44+
# id: deployment
45+
# with:
46+
# step: start
47+
# token: ${{ secrets.GITHUB_TOKEN }}
48+
# env: carthage
49+
50+
# - uses: joutvhu/get-release@v1
51+
# id: release
52+
# with:
53+
# tag_name: ${{ github.event.inputs.version }}
54+
# env:
55+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
57+
# - uses: actions/checkout@v2
58+
# - run: carthage build --no-skip-current --use-xcframeworks --platform macOS,iOS,watchOS,tvOS --archive
59+
# - run: mv PromiseKit.framework.zip PromiseKit-$v.framework.zip
60+
61+
# - uses: actions/upload-release-asset@v1
62+
# with:
63+
# upload_url: ${{ steps.outputs.release.upload_url }}
64+
# asset_path: ./PromiseKit-$v.framework.zip
65+
# asset_name: PromiseKit-$v.framework.zip
66+
# asset_content_type: application/zip
67+
# env:
68+
# v: ${{ github.event.inputs.version }}
69+
# GITHUB_TOKEN: ${{ github.token }}
70+
71+
# - name: Seal Deployment
72+
# uses: bobheadxi/[email protected]
73+
# if: always()
74+
# with:
75+
# step: finish
76+
# token: ${{ secrets.GITHUB_TOKEN }}
77+
# status: ${{ job.status }}
78+
# deployment_id: ${{ steps.deployment.outputs.deployment_id }}
79+
80+
docs:
81+
runs-on: macos-latest
82+
steps:
83+
84+
- name: Start Deployment
85+
uses: bobheadxi/[email protected]
86+
id: deployment
87+
with:
88+
step: start
89+
token: ${{ secrets.GITHUB_TOKEN }}
90+
env: docs
91+
92+
- uses: actions/checkout@v2
93+
- run: gem install jazzy
94+
- run: |
95+
jazzy --config .github/jazzy.yml \
96+
--github_url 'https://github.com/mxcl/PromiseKit' \
97+
--module-version ${{ github.event.inputs.version }}
98+
- run: git remote update
99+
- run: git checkout gh-pages
100+
- run: rm -rf reference/v6
101+
- run: mv output reference/v6
102+
- run: git add reference/v6
103+
- run: git config user.name github-actions
104+
- run: git config user.email [email protected]
105+
- run: git commit -m 'Updated docs for v${{ github.event.inputs.version }}'
106+
- run: git remote add secure-origin https://${{ secrets.JAZZY_PAT }}@github.com/mxcl/PromiseKit.git
107+
- run: git push secure-origin gh-pages
108+
109+
- name: Seal Deployment
110+
uses: bobheadxi/[email protected]
111+
if: always()
112+
with:
113+
step: finish
114+
token: ${{ secrets.GITHUB_TOKEN }}
115+
status: ${{ job.status }}
116+
deployment_id: ${{ steps.deployment.outputs.deployment_id }}

.github/workflows/ci-exhaustive.yml renamed to .github/workflows/ci.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,4 @@ jobs:
152152
- uses: maxim-lobanov/setup-xcode@v1
153153
with: {xcode-version: ^12}
154154
- uses: actions/checkout@v2
155-
- run: pod lib lint --subspec=PromiseKit/CorePromise --fail-fast --swift-version=5.4
156-
157-
create-release:
158-
runs-on: ubuntu-latest
159-
needs:
160-
- test
161-
- carthage
162-
- build-linux-swift-5
163-
- cocoapods-5-4
164-
steps:
165-
- uses: actions/checkout@v2
166-
with:
167-
fetch-depth: 0 # zero means “all” (or push fails)
168-
token: ${{ secrets.JAZZY_PAT }} # or won’t trigger our workflow
155+
- run: pod lib lint

.github/workflows/post-publish.yml

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

.github/workflows/publish.yml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,51 @@ on:
66
description: Version to publish
77
required: true
88
jobs:
9-
lint:
10-
runs-on: macos-latest
9+
ci:
10+
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: aurelien-baudet/workflow-dispatch@v2
1313
with:
14-
submodules: true
15-
- run: pod lib lint
14+
workflow: CI (exhaustive)
15+
token: ${{ secrets.JAZZY_PAT }}
16+
wait-for-completion: true
1617

1718
create-release:
1819
runs-on: ubuntu-latest
1920
needs: lint
21+
env:
22+
v: ${{ github.event.inputs.version }}
2023
steps:
21-
22-
- uses: jungwinter/split@v1
23-
id: split
24-
with:
25-
seperator: /
26-
msg: ${{ github.ref }}
27-
2824
- uses: actions/checkout@v2
2925
with:
30-
ref: master
3126
fetch-depth: 0 # zero means “all” (or push fails)
32-
3327
- name: Update committed versions
3428
run: |
3529
ruby -i -pe "sub(/CURRENT_PROJECT_VERSION = [0-9.]+/, 'CURRENT_PROJECT_VERSION = $v')" PromiseKit.xcodeproj/project.pbxproj
3630
ruby -i -pe "sub(/s.version = '[0-9.]+'/, 's.version = \"$v\"')" PromiseKit.podspec
37-
env:
38-
v: ${{ github.event.inputs.version }}
3931
- run: |
4032
! (git diff --quiet)
41-
- run: |
33+
- name: Commit
34+
run: |
4235
git config user.name github-actions
4336
git config user.email [email protected]
4437
git commit -am "PromiseKit $v"
4538
git push
46-
env:
47-
v: ${{ github.event.inputs.version }}
48-
4939
- uses: softprops/action-gh-release@v1
50-
id: release
5140
env:
5241
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5342
with:
5443
tag_name: ${{ github.event.inputs.version }}
5544
name: ${{ github.event.inputs.version }}
45+
46+
cd:
47+
needs: create-release
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: aurelien-baudet/workflow-dispatch@v2
51+
with:
52+
workflow: CD
53+
token: ${{ secrets.JAZZY_PAT }}
54+
inputs: "{\"version\": \'${{ github.event.inputs.version }}\"}"
55+
ref: master # or doesn’t use our new commit above
56+
wait-for-completion: true

0 commit comments

Comments
 (0)