-
Notifications
You must be signed in to change notification settings - Fork 2
119 lines (119 loc) · 4.08 KB
/
Deploying.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Deploying
on:
push:
branches:
- master
release:
types: [created]
jobs:
push_deploy_staging:
if: github.event_name == 'push'
name: Deploying to Testflight for Staging
runs-on: macOS-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
env:
token: ${{ secrets.GITHUB_TOKENN }}
- name: Get version from date
run: |
echo "::set-output name=VERSION::$(date +'%Y.%-m.%-d')"
id: dateversion
- name: Get commits count
run: |
echo "::set-output name=GIT_COMMIT_NUMBER::$(git rev-list --count HEAD)"
id: commits
- name: Set version and build number
run: |
agvtool new-marketing-version ${{steps.dateversion.outputs.VERSION}}
agvtool new-version -all ${{steps.commits.outputs.GIT_COMMIT_NUMBER}}
- name: Install gpg
run: brew install gpg
- name: Setup provisioning profile
env:
IOS_KEYS: ${{ secrets.IOS_KEYS }}
run: .github/secrets/decrypt_secrets.sh
- name: Archiving project
env:
PR_NUMBER: $(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
run: .github/scripts/archive_staging_app.sh
- name: Exporting .ipa
run: .github/scripts/export_ipa.sh
- name: Publishing app
if: success()
env:
APPLEID_USERNAME: ${{ secrets.APPLEID_USERNAME }}
APPLEID_PASSWORD: ${{ secrets.APPLEID_PASSWORD }}
run: .github/scripts/publish_testflight.sh
release_deploy_production:
if: github.event_name == 'release'
name: Deploying to Testflight for Production
runs-on: macOS-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
env:
token: ${{ secrets.GITHUB_TOKENN }}
- name: Get latest tag
run: |
echo "::set-output name=LATEST_TAG_NUMBER::$(git describe --tags `git rev-list --tags --max-count=1`)"
id: tags
- name: Get commits count
run: |
echo "::set-output name=GIT_COMMIT_NUMBER::$(git rev-list --count HEAD)"
id: commits
- name: Set version and build number
run: |
agvtool new-marketing-version ${{steps.tags.outputs.LATEST_TAG_NUMBER}}
agvtool new-version -all ${{steps.commits.outputs.GIT_COMMIT_NUMBER}}
- name: Install gpg
run: brew install gpg
- name: Setup provisioning profile
env:
IOS_KEYS: ${{ secrets.IOS_KEYS }}
run: .github/secrets/decrypt_secrets.sh
- name: Archiving project
env:
PR_NUMBER: $(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
run: .github/scripts/archive_production_app.sh
- name: Exporting .ipa
run: .github/scripts/export_ipa.sh
- name: Publishing app
if: success()
env:
APPLEID_USERNAME: ${{ secrets.APPLEID_USERNAME }}
APPLEID_PASSWORD: ${{ secrets.APPLEID_PASSWORD }}
run: .github/scripts/publish_testflight.sh
version-update:
if: github.event_name == 'release'
name: Version increment
runs-on: macOS-latest
needs: [release_deploy_production]
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
env:
token: ${{ secrets.GITHUB_TOKENN }}
- name: Get version from releases
run: |
echo "::set-output name=LATEST_TAG_NUMBER::$(git describe --tags `git rev-list --tags --max-count=1`)"
id: tagversion
- name: Get commits count
run: |
echo "::set-output name=GIT_COMMIT_NUMBER::$(git rev-list --count HEAD)"
id: commits
- name: Set version and build number
run: |
agvtool new-marketing-version ${{steps.tagversion.outputs.LATEST_TAG_NUMBER}}
agvtool new-version -all ${{steps.commits.outputs.GIT_COMMIT_NUMBER}}
- name: update
run: |
git add .
git commit -m "bump version"
git push origin HEAD:master