-
Notifications
You must be signed in to change notification settings - Fork 11
150 lines (124 loc) · 4.84 KB
/
create_variants.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Create DMG Variants
on:
workflow_dispatch:
workflow_call:
secrets:
APPLE_API_KEY_BASE64:
required: true
APPLE_API_KEY_ID:
required: true
APPLE_API_KEY_ISSUER:
required: true
ASANA_ACCESS_TOKEN:
required: true
AWS_ACCESS_KEY_ID_RELEASE_S3:
required: true
AWS_SECRET_ACCESS_KEY_RELEASE_S3:
required: true
MATCH_PASSWORD:
required: true
MM_HANDLES_BASE64:
required: true
MM_WEBHOOK_URL:
required: true
SSH_PRIVATE_KEY_FASTLANE_MATCH:
required: true
jobs:
set-up-variants:
name: Set Up Variants
runs-on: macos-14
timeout-minutes: 15
outputs:
build-variants-1: ${{ steps.get-build-variants.outputs.build-variants-1 }}
build-variants-2: ${{ steps.get-build-variants.outputs.build-variants-2 }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Fetch Build Variants
id: get-build-variants
uses: ./.github/actions/asana-get-build-variants-list
with:
access-token: ${{ secrets.ASANA_ACCESS_TOKEN }}
atb-asana-task-id: ${{ vars.DMG_VARIANTS_LIST_TASK_ID }}
origin-asana-section-id: ${{ vars.DMG_VARIANTS_ORIGIN_SECTION_ID }}
download-dmg-and-upload-artifact:
name: Download Release App and upload artifact
runs-on: macos-14
timeout-minutes: 15
steps:
- name: Download release app
run: |
curl -fLSs "${{ vars.RELEASE_DMG_URL }}" --output duckduckgo.dmg
- name: Upload DMG artifact
uses: actions/upload-artifact@v4
with:
name: duckduckgo-dmg
path: ${{ github.workspace }}/duckduckgo.dmg
retention-days: 1
create-variants-1:
name: Create Variant
needs: [set-up-variants, download-dmg-and-upload-artifact]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.set-up-variants.outputs.build-variants-1) }}
uses: ./.github/workflows/create_variant.yml
with:
atb-variant: ${{ matrix.variant }}
origin-variant: ${{ matrix.origin }}
secrets:
APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_KEY_ISSUER: ${{ secrets.APPLE_API_KEY_ISSUER }}
AWS_ACCESS_KEY_ID_RELEASE_S3: ${{ secrets.AWS_ACCESS_KEY_ID_RELEASE_S3 }}
AWS_SECRET_ACCESS_KEY_RELEASE_S3: ${{ secrets.AWS_SECRET_ACCESS_KEY_RELEASE_S3 }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
SSH_PRIVATE_KEY_FASTLANE_MATCH: ${{ secrets.SSH_PRIVATE_KEY_FASTLANE_MATCH }}
create-variants-2:
name: Create Variant
needs: [set-up-variants, download-dmg-and-upload-artifact]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.set-up-variants.outputs.build-variants-2) }}
uses: ./.github/workflows/create_variant.yml
with:
atb-variant: ${{ matrix.variant }}
origin-variant: ${{ matrix.origin }}
secrets:
APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_KEY_ISSUER: ${{ secrets.APPLE_API_KEY_ISSUER }}
AWS_ACCESS_KEY_ID_RELEASE_S3: ${{ secrets.AWS_ACCESS_KEY_ID_RELEASE_S3 }}
AWS_SECRET_ACCESS_KEY_RELEASE_S3: ${{ secrets.AWS_SECRET_ACCESS_KEY_RELEASE_S3 }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
SSH_PRIVATE_KEY_FASTLANE_MATCH: ${{ secrets.SSH_PRIVATE_KEY_FASTLANE_MATCH }}
mattermost:
name: Send Mattermost message
needs: [create-variants-1, create-variants-2]
runs-on: macos-15
env:
success: ${{ needs.create-variants-1.result == 'success' && needs.create-variants-2.result == 'success' }}
failure: ${{ needs.create-variants-1.result == 'failure' || needs.create-variants-2.result == 'failure' }}
steps:
- name: Check out the code
if: ${{ env.success || env.failure }} # Don't execute when cancelled
uses: actions/checkout@v4
with:
sparse-checkout: |
.github
Gemfile
Gemfile.lock
fastlane
scripts
- name: Set up fastlane
if: ${{ env.success || env.failure }} # Don't execute when cancelled
run: bundle install
- name: Send Mattermost message
if: ${{ env.success || env.failure }} # Don't execute when cancelled
env:
GH_TOKEN: ${{ github.token }}
WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
bundle exec fastlane run mattermost_send_message \
mattermost_webhook_url:${{ secrets.MM_WEBHOOK_URL }} \
github_handle:${{ github.actor }} \
template_name:$([[ "${{ env.success }}" == "true" ]] && echo "variants-release-published" || echo "variants-release-failed")