-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
71 lines (65 loc) · 1.93 KB
/
publish.yml
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
name: Publish
on:
workflow_dispatch:
inputs:
version:
description: semantic version to publish
required: true
concurrency:
group: publish-{{github.event.inputs.version}}
cancel-in-progress: true
jobs:
ci:
uses: ./.github/workflows/ci.yml
lint:
runs-on: macos-latest
strategy:
matrix:
xcode:
- ^15
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode }}
- uses: actions/checkout@v3
with:
submodules: true
- run: pod lib lint --fail-fast --allow-warnings
create-release:
runs-on: ubuntu-latest
needs: [ci, lint]
env:
v: ${{ github.event.inputs.version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # zero means “all” (or push fails)
- name: Update committed versions
run: |
ruby -i -pe "sub(/CURRENT_PROJECT_VERSION = [0-9.]+/, 'CURRENT_PROJECT_VERSION = $v')" PromiseKit.xcodeproj/project.pbxproj
ruby -i -pe "sub(/s.version = '[0-9.]+'/, 's.version = \'$v\'')" PromiseKit.podspec
- run: |
! (git diff --quiet)
- name: Commit
run: |
git config user.name github-actions
git config user.email [email protected]
git commit -am "PromiseKit $v"
git push
- uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
name: ${{ github.event.inputs.version }}
cd:
needs: create-release
runs-on: ubuntu-latest
steps:
- uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: CD
token: ${{ secrets.JAZZY_PAT }}
inputs: "{\"version\": \"${{ github.event.inputs.version }}\"}"
ref: ${{ env.GITHUB_REF_NAME }} # or uses the SHA rather than branch and thus the above commit is not used
wait-for-completion: true