-
Notifications
You must be signed in to change notification settings - Fork 221
78 lines (65 loc) · 2.63 KB
/
deploy.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
72
73
74
75
76
77
78
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support documentation.
# This workflow will do a clean install of swift dependencies, build the source code and deploy/publish a new release
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift
name: Deploy and Publish
on:
workflow_run:
workflows: ["Build and Test"]
branches: [ master ]
types:
- completed
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
deploy:
if: "!contains(github.event.head_commit.message, 'skip ci')"
name: Deploy and Publish
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
steps:
- uses: actions/checkout@v2
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '12.5'
- name: Install Semantic Release dependencies
run: |
pip3 install --user bumpversion
npm install -g semantic-release
npm install -g @semantic-release/changelog
npm install -g @semantic-release/exec
npm install -g @semantic-release/git
npm install -g @semantic-release/github
npm install -g @semantic-release/commit-analyzer
npm install -g @semantic-release/release-notes-generator
- name: Check if semantic release generated a release
id: is_new_release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo ::set-output name=IS_NEW_RELEASE::$(npx semantic-release --dry-run | grep -c -i "Published release")
echo "The full TAG - ${{ github.ref }}"
- name: Validate Pods
run: Scripts/pod-lint.sh
- name: Publish to Git Releases and Tags
if: ${{ steps.is_new_release.outputs.IS_NEW_RELEASE == '1' }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release # --dry-run --branches 9739_gha
- name: Publish to Cocoapods
if: ${{ steps.is_new_release.outputs.IS_NEW_RELEASE == '1' }}
continue-on-error: true # Do not fail on: Unable to accept duplicate entry on pod push
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: Scripts/deploy-to-cocoapods-gha.sh
- name: Publish Documentation
if: ${{ steps.is_new_release.outputs.IS_NEW_RELEASE == '1' }}
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: Scripts/publish-documentation-gha.sh