Skip to content

Commit ee5944c

Browse files
committed
update workflows
1 parent ad4856a commit ee5944c

File tree

2 files changed

+83
-35
lines changed

2 files changed

+83
-35
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,26 @@ 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'
1010

1111
jobs:
12+
release-dry-run:
13+
runs-on: ubuntu-latest
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+
- name: Determine tag for next release
24+
run: echo $(git describe --tags --abbrev=0 --exact-match || echo '')
25+
1226
ios:
1327
runs-on: macos-latest
1428
steps:
@@ -34,7 +48,6 @@ jobs:
3448
- name: Send codecov
3549
run: bash <(curl https://codecov.io/bash)
3650

37-
3851
macos:
3952
runs-on: macos-latest
4053
steps:
@@ -152,7 +165,7 @@ jobs:
152165
env:
153166
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
154167

155-
release:
168+
upload-assets:
156169
runs-on: macos-latest
157170
steps:
158171
- uses: actions/checkout@v2
Lines changed: 67 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,41 @@
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+
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+
1030
cocoapods:
31+
needs: release
32+
if: needs.release.outputs.current_tag != ''
1133
runs-on: macos-11
1234
steps:
13-
- uses: actions/checkout@v2
35+
- name: Checkout repository
36+
uses: actions/checkout@v2
37+
with:
38+
ref: ${{ needs.release.outputs.current_tag }}
1439
- name: CocoaPods
1540
run: set -o pipefail && env NSUnbufferedIO=YES pod lib lint --allow-warnings --verbose
1641
- name: Deploy CocoaPods
@@ -19,10 +44,15 @@ jobs:
1944
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
2045
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
2146

22-
docs:
47+
upload-assets:
48+
needs: release
49+
if: needs.release.outputs.current_tag != ''
2350
runs-on: macos-11
2451
steps:
25-
- uses: actions/checkout@v2
52+
- name: Checkout repository
53+
uses: actions/checkout@v2
54+
with:
55+
ref: ${{ needs.release.outputs.current_tag }}
2656
- name: Cache Gems
2757
id: cache-gems
2858
uses: actions/cache@v2
@@ -31,25 +61,34 @@ jobs:
3161
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
3262
restore-keys: |
3363
${{ runner.os }}-gem-
34-
- name: Install Bundle
64+
- name: Submodules and Bundle Install
3565
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'
3769
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
4172
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
4576
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
4882

49-
release:
83+
publish-docs:
84+
needs: release
85+
if: needs.release.outputs.current_tag != ''
5086
runs-on: macos-11
5187
steps:
52-
- uses: actions/checkout@v2
88+
- name: Checkout repository
89+
uses: actions/checkout@v2
90+
with:
91+
ref: ${{ needs.release.outputs.current_tag }}
5392
- name: Cache Gems
5493
id: cache-gems
5594
uses: actions/cache@v2
@@ -58,21 +97,17 @@ jobs:
5897
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
5998
restore-keys: |
6099
${{ runner.os }}-gem-
61-
- name: Submodules and Bundle Install
100+
- name: Install Bundle
62101
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
66103
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
69107
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
73111
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

Comments
 (0)