Skip to content

Commit 922e5bf

Browse files
authored
ci: add auto release (#1632)
1 parent e09104e commit 922e5bf

11 files changed

+4952
-45
lines changed

Diff for: .github/workflows/ci.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
push:
44
branches: [ master ]
55
pull_request:
6-
branches: [ master ]
6+
branches: [ '**' ]
77
env:
88
CI_XCODE_11: '/Applications/Xcode_11.7.app/Contents/Developer'
99
CI_XCODE_13: '/Applications/Xcode_13.1.app/Contents/Developer'
@@ -34,7 +34,6 @@ jobs:
3434
- name: Send codecov
3535
run: bash <(curl https://codecov.io/bash)
3636

37-
3837
macos:
3938
runs-on: macos-latest
4039
steps:
@@ -152,7 +151,7 @@ jobs:
152151
env:
153152
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
154153

155-
release:
154+
assets:
156155
runs-on: macos-latest
157156
steps:
158157
- uses: actions/checkout@v2
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,23 @@
1-
name: release
1+
name: release-automated
22
on:
3-
release:
4-
types: [published]
3+
push:
4+
branches: [ master, release, alpha, beta ]
55
env:
66
CI_XCODE_11: '/Applications/Xcode_11.7.app/Contents/Developer'
77
CI_XCODE_13: '/Applications/Xcode_13.0.app/Contents/Developer'
88

99
jobs:
10-
cocoapods:
11-
runs-on: macos-11
12-
steps:
13-
- uses: actions/checkout@v2
14-
- name: CocoaPods
15-
run: set -o pipefail && env NSUnbufferedIO=YES pod lib lint --allow-warnings --verbose
16-
- name: Deploy CocoaPods
17-
run: set -o pipefail && env NSUnbufferedIO=YES pod trunk push Parse.podspec --allow-warnings --verbose
18-
env:
19-
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
20-
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
21-
22-
docs:
23-
runs-on: macos-11
10+
release:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
current_tag: ${{ steps.tag.outputs.current_tag }}
2414
steps:
2515
- uses: actions/checkout@v2
16+
with:
17+
persist-credentials: false
18+
- uses: actions/setup-node@v2
19+
with:
20+
node-version: 14
2621
- name: Cache Gems
2722
id: cache-gems
2823
uses: actions/cache@v2
@@ -31,25 +26,47 @@ jobs:
3126
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
3227
restore-keys: |
3328
${{ runner.os }}-gem-
34-
- name: Install Bundle
29+
- name: Submodules and Bundle Install
3530
run: |
36-
bundle config path vendor/bundle
31+
git submodule update --init --recursive
32+
sudo gem install bundler
33+
bundle config set path 'vendor/bundle'
3734
bundle install
38-
- name: Create Jazzy Docs
39-
run: |
40-
./Scripts/jazzy.sh
35+
- run: npm ci
36+
- run: npx semantic-release
4137
env:
42-
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
43-
- name: Deploy Jazzy Docs
44-
uses: peaceiris/actions-gh-pages@v3
38+
GH_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
- name: Determine tag on current commit
41+
id: tag
42+
run: echo "::set-output name=current_tag::$(git describe --tags --abbrev=0 --exact-match || echo '')"
43+
44+
cocoapods:
45+
needs: release
46+
if: needs.release.outputs.current_tag != ''
47+
runs-on: macos-11
48+
steps:
49+
- name: Checkout repository
50+
uses: actions/checkout@v2
4551
with:
46-
github_token: ${{ secrets.GITHUB_TOKEN }}
47-
publish_dir: ./docs
52+
ref: ${{ needs.release.outputs.current_tag }}
53+
- name: CocoaPods
54+
run: set -o pipefail && env NSUnbufferedIO=YES pod lib lint --allow-warnings --verbose
55+
- name: Deploy CocoaPods
56+
run: set -o pipefail && env NSUnbufferedIO=YES pod trunk push Parse.podspec --allow-warnings --verbose
57+
env:
58+
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
59+
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
4860

49-
release:
61+
assets:
62+
needs: release
63+
if: needs.release.outputs.current_tag != ''
5064
runs-on: macos-11
5165
steps:
52-
- uses: actions/checkout@v2
66+
- name: Checkout repository
67+
uses: actions/checkout@v2
68+
with:
69+
ref: ${{ needs.release.outputs.current_tag }}
5370
- name: Cache Gems
5471
id: cache-gems
5572
uses: actions/cache@v2
@@ -73,6 +90,38 @@ jobs:
7390
with:
7491
repo_token: ${{ secrets.GITHUB_TOKEN }}
7592
file: build/release/*
76-
tag: ${{ github.ref }}
93+
tag: ${{ needs.release.outputs.current_tag }}
7794
overwrite: true
7895
file_glob: true
96+
97+
publish-docs:
98+
needs: release
99+
if: needs.release.outputs.current_tag != ''
100+
runs-on: macos-11
101+
steps:
102+
- name: Checkout repository
103+
uses: actions/checkout@v2
104+
with:
105+
ref: ${{ needs.release.outputs.current_tag }}
106+
- name: Cache Gems
107+
id: cache-gems
108+
uses: actions/cache@v2
109+
with:
110+
path: vendor/bundle
111+
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
112+
restore-keys: |
113+
${{ runner.os }}-gem-
114+
- name: Install Bundle
115+
run: |
116+
bundle config path vendor/bundle
117+
bundle install
118+
- name: Create Jazzy Docs
119+
run: |
120+
./Scripts/jazzy.sh
121+
env:
122+
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
123+
- name: Deploy Jazzy Docs
124+
uses: peaceiris/actions-gh-pages@v3
125+
with:
126+
github_token: ${{ secrets.GITHUB_TOKEN }}
127+
publish_dir: ./docs

Diff for: .gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,14 @@ docs/
3838
.idea/
3939
ParseFacebookUtils/Vendor
4040
ParseUI/Vendor
41+
42+
# VSC
43+
.project
44+
45+
# Node
46+
node_modules/
47+
npm-debug.log
48+
49+
# Ruby
50+
.bundle
51+
Vendor/

Diff for: .releaserc/commit.hbs

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
*{{#if scope}} **{{scope}}:**
2+
{{~/if}} {{#if subject}}
3+
{{~subject}}
4+
{{~else}}
5+
{{~header}}
6+
{{~/if}}
7+
8+
{{~!-- commit link --}} {{#if @root.linkReferences~}}
9+
([{{shortHash}}](
10+
{{~#if @root.repository}}
11+
{{~#if @root.host}}
12+
{{~@root.host}}/
13+
{{~/if}}
14+
{{~#if @root.owner}}
15+
{{~@root.owner}}/
16+
{{~/if}}
17+
{{~@root.repository}}
18+
{{~else}}
19+
{{~@root.repoUrl}}
20+
{{~/if}}/
21+
{{~@root.commit}}/{{hash}}))
22+
{{~else}}
23+
{{~shortHash}}
24+
{{~/if}}
25+
26+
{{~!-- commit references --}}
27+
{{~#if references~}}
28+
, closes
29+
{{~#each references}} {{#if @root.linkReferences~}}
30+
[
31+
{{~#if this.owner}}
32+
{{~this.owner}}/
33+
{{~/if}}
34+
{{~this.repository}}#{{this.issue}}](
35+
{{~#if @root.repository}}
36+
{{~#if @root.host}}
37+
{{~@root.host}}/
38+
{{~/if}}
39+
{{~#if this.repository}}
40+
{{~#if this.owner}}
41+
{{~this.owner}}/
42+
{{~/if}}
43+
{{~this.repository}}
44+
{{~else}}
45+
{{~#if @root.owner}}
46+
{{~@root.owner}}/
47+
{{~/if}}
48+
{{~@root.repository}}
49+
{{~/if}}
50+
{{~else}}
51+
{{~@root.repoUrl}}
52+
{{~/if}}/
53+
{{~@root.issue}}/{{this.issue}})
54+
{{~else}}
55+
{{~#if this.owner}}
56+
{{~this.owner}}/
57+
{{~/if}}
58+
{{~this.repository}}#{{this.issue}}
59+
{{~/if}}{{/each}}
60+
{{~/if}}
61+

Diff for: .releaserc/footer.hbs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{#if noteGroups}}
2+
{{#each noteGroups}}
3+
4+
### {{title}}
5+
6+
{{#each notes}}
7+
* {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}} ([{{commit.shortHash}}]({{commit.shortHash}}))
8+
{{/each}}
9+
{{/each}}
10+
11+
{{/if}}

Diff for: .releaserc/header.hbs

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{#if isPatch~}}
2+
##
3+
{{~else~}}
4+
#
5+
{{~/if}} {{#if @root.linkCompare~}}
6+
[{{version}}](
7+
{{~#if @root.repository~}}
8+
{{~#if @root.host}}
9+
{{~@root.host}}/
10+
{{~/if}}
11+
{{~#if @root.owner}}
12+
{{~@root.owner}}/
13+
{{~/if}}
14+
{{~@root.repository}}
15+
{{~else}}
16+
{{~@root.repoUrl}}
17+
{{~/if~}}
18+
/compare/{{previousTag}}...{{currentTag}})
19+
{{~else}}
20+
{{~version}}
21+
{{~/if}}
22+
{{~#if title}} "{{title}}"
23+
{{~/if}}
24+
{{~#if date}} ({{date}})
25+
{{/if}}

Diff for: .releaserc/template.hbs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{> header}}
2+
3+
{{#each commitGroups}}
4+
5+
{{#if title}}
6+
### {{title}}
7+
8+
{{/if}}
9+
{{#each commits}}
10+
{{> commit root=@root}}
11+
{{/each}}
12+
{{/each}}
13+
14+
{{> footer}}

Diff for: CHANGELOG.md

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
# Parse-SDK-iOS-OSX Changelog
2-
3-
### master
4-
[Full Changelog](https://github.com/parse-community/Parse-SDK-iOS-OSX/compare/1.19.2...master)
5-
* _Contributing to this repo? Add info about your change here to be included in next release_
6-
7-
### 1.19.2
1+
# 1.19.2
82
[Full Changelog](https://github.com/parse-community/Parse-SDK-iOS-OSX/compare/1.19.1...1.19.2)
93

104
__Improvements__
@@ -13,7 +7,7 @@ __Improvements__
137
__Fixes__
148
- Crash in Twitter login flow ([#1566](https://github.com/parse-community/Parse-SDK-iOS-OSX/pull/1567)), thanks to [dhana](https://github.com/dsp1589).
159

16-
### 1.19.1
10+
# 1.19.1
1711
[Full Changelog](https://github.com/parse-community/Parse-SDK-iOS-OSX/compare/1.19.0...1.19.1)
1812

1913
__Improvements__
@@ -24,7 +18,7 @@ __Fixes__
2418
- Bolts compilation error in Xcode 12 ([#1548](https://github.com/parse-community/Parse-SDK-iOS-OSX/pull/1548)), thanks to [Derek Lee](https://github.com/derekleerock).
2519
- App Store submission failed for MinimumOSVersion ([#1515](https://github.com/parse-community/Parse-SDK-iOS-OSX/issues/1515)), thanks to [Manuel Trezza](https://github.com/mtrezza).
2620

27-
### 1.19.0
21+
# 1.19.0
2822
[Full Changelog](https://github.com/parse-community/Parse-SDK-iOS-OSX/compare/1.18.0...1.19.0)
2923

3024
__New features__
@@ -38,8 +32,7 @@ __Fixes__
3832
- Removes deprecated UIWebView usage ([#1511](https://github.com/parse-community/Parse-SDK-iOS-OSX/pull/1511)), thanks to [Nathan Kellert](https://github.com/parse-community/Parse-SDK-iOS-OSX/commits?author=noobs2ninjas).
3933
- Fixes building with Xcode 12 ([#1527](https://github.com/parse-community/Parse-SDK-iOS-OSX/pull/1527)), thanks to [Steffen Matthischke](https://github.com/HeEAaD).
4034

41-
42-
### 1.18.0
35+
# 1.18.0
4336
[Full Changelog](https://github.com/parse-community/Parse-SDK-iOS-OSX/compare/1.17.3...1.18.0)
4437

4538
__New features__
@@ -66,7 +59,7 @@ __Fixes__
6659
After getting in contact with the Bolts Framework maintainers from Facebook they have allowed us to get changes in to fix app store declines due to still using UIWebView(iOS only) rather than updating to WKWebView(iOS, macOS, and iPad OS compatible). Those that got declined should be able to re-submit after updating to the latest version of this SDK as well as its dependencies.
6760

6861

69-
### 1.17.3
62+
# 1.17.3
7063
[Full Changelog](https://github.com/parse-community/Parse-SDK-iOS-OSX/compare/1.17.2...1.17.3)
7164

7265
__New Features__

0 commit comments

Comments
 (0)