1
- name : release
1
+ name : release-automated
2
2
on :
3
- release :
4
- types : [published ]
3
+ push :
4
+ branches : [ master, release, alpha, beta ]
5
5
env :
6
6
CI_XCODE_11 : ' /Applications/Xcode_11.7.app/Contents/Developer'
7
7
CI_XCODE_13 : ' /Applications/Xcode_13.0.app/Contents/Developer'
8
8
9
9
jobs :
10
+ release :
11
+ runs-on : ubuntu-latest
12
+ outputs :
13
+ current_tag : ${{ steps.tag.outputs.current_tag }}
14
+ steps :
15
+ - uses : actions/checkout@v2
16
+ with :
17
+ persist-credentials : false
18
+ - uses : actions/setup-node@v2
19
+ with :
20
+ node-version : 14
21
+ - run : npm ci
22
+ - run : npx semantic-release
23
+ env :
24
+ GH_TOKEN : ${{ secrets.RELEASE_GITHUB_TOKEN }}
25
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
26
+ - name : Determine tag on current commit
27
+ id : tag
28
+ run : echo "::set-output name=current_tag::$(git describe --tags --abbrev=0 --exact-match || echo '')"
29
+
10
30
cocoapods :
31
+ needs : release
32
+ if : needs.release.outputs.current_tag != ''
11
33
runs-on : macos-11
12
34
steps :
13
- - uses : actions/checkout@v2
35
+ - name : Checkout repository
36
+ uses : actions/checkout@v2
37
+ with :
38
+ ref : ${{ needs.release.outputs.current_tag }}
14
39
- name : CocoaPods
15
40
run : set -o pipefail && env NSUnbufferedIO=YES pod lib lint --allow-warnings --verbose
16
41
- name : Deploy CocoaPods
@@ -19,10 +44,15 @@ jobs:
19
44
COCOAPODS_TRUNK_TOKEN : ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
20
45
DEVELOPER_DIR : ${{ env.CI_XCODE_13 }}
21
46
22
- docs :
47
+ upload-assets :
48
+ needs : release
49
+ if : needs.release.outputs.current_tag != ''
23
50
runs-on : macos-11
24
51
steps :
25
- - uses : actions/checkout@v2
52
+ - name : Checkout repository
53
+ uses : actions/checkout@v2
54
+ with :
55
+ ref : ${{ needs.release.outputs.current_tag }}
26
56
- name : Cache Gems
27
57
id : cache-gems
28
58
uses : actions/cache@v2
@@ -31,25 +61,34 @@ jobs:
31
61
key : ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
32
62
restore-keys : |
33
63
${{ runner.os }}-gem-
34
- - name : Install Bundle
64
+ - name : Submodules and Bundle Install
35
65
run : |
36
- bundle config path vendor/bundle
66
+ git submodule update --init --recursive
67
+ sudo gem install bundler
68
+ bundle config set path 'vendor/bundle'
37
69
bundle install
38
- - name : Create Jazzy Docs
39
- run : |
40
- ./Scripts/jazzy.sh
70
+ - name : Build Release
71
+ run : set -o pipefail && env NSUnbufferedIO=YES bundle exec rake package:release
41
72
env :
42
- DEVELOPER_DIR : ${{ env.CI_XCODE_13 }}
43
- - name : Deploy Jazzy Docs
44
- uses : peaceiris/actions-gh-pages@v3
73
+ DEVELOPER_DIR : ${{ env.CI_XCODE_11 }}
74
+ - name : Deploy assets
75
+ uses : svenstaro/upload-release-action@v2
45
76
with :
46
- github_token : ${{ secrets.GITHUB_TOKEN }}
47
- publish_dir : ./docs
77
+ repo_token : ${{ secrets.GITHUB_TOKEN }}
78
+ file : build/release/*
79
+ tag : ${{ needs.release.outputs.current_tag }}
80
+ overwrite : true
81
+ file_glob : true
48
82
49
- release :
83
+ publish-docs :
84
+ needs : release
85
+ if : needs.release.outputs.current_tag != ''
50
86
runs-on : macos-11
51
87
steps :
52
- - uses : actions/checkout@v2
88
+ - name : Checkout repository
89
+ uses : actions/checkout@v2
90
+ with :
91
+ ref : ${{ needs.release.outputs.current_tag }}
53
92
- name : Cache Gems
54
93
id : cache-gems
55
94
uses : actions/cache@v2
@@ -58,21 +97,17 @@ jobs:
58
97
key : ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
59
98
restore-keys : |
60
99
${{ runner.os }}-gem-
61
- - name : Submodules and Bundle Install
100
+ - name : Install Bundle
62
101
run : |
63
- git submodule update --init --recursive
64
- sudo gem install bundler
65
- bundle config set path 'vendor/bundle'
102
+ bundle config path vendor/bundle
66
103
bundle install
67
- - name : Build Release
68
- run : set -o pipefail && env NSUnbufferedIO=YES bundle exec rake package:release
104
+ - name : Create Jazzy Docs
105
+ run : |
106
+ ./Scripts/jazzy.sh
69
107
env :
70
- DEVELOPER_DIR : ${{ env.CI_XCODE_11 }}
71
- - name : Deploy assets
72
- uses : svenstaro/upload-release-action@v2
108
+ DEVELOPER_DIR : ${{ env.CI_XCODE_13 }}
109
+ - name : Deploy Jazzy Docs
110
+ uses : peaceiris/actions-gh-pages@v3
73
111
with :
74
- repo_token : ${{ secrets.GITHUB_TOKEN }}
75
- file : build/release/*
76
- tag : ${{ github.ref }}
77
- overwrite : true
78
- file_glob : true
112
+ github_token : ${{ secrets.GITHUB_TOKEN }}
113
+ publish_dir : ./docs
0 commit comments