-
Notifications
You must be signed in to change notification settings - Fork 424
90 lines (76 loc) · 2.98 KB
/
adhoc.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
name: Make ad-hoc build
on:
workflow_dispatch:
inputs:
suffix:
description: "Text to append at the end of the build name"
required: false
asana-task-url:
description: "Asana task URL"
required: false
type: string
jobs:
make-adhoc:
runs-on: macos-13
name: Make ad-hoc build
steps:
- name: Register SSH keys for access to certificates
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY_FASTLANE_MATCH }}
- name: Check out the code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_$(<.xcode-version).app/Contents/Developer
- name: Prepare fastlane
run: bundle install
- name: Archive and upload the app
env:
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 }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
run: |
if [[ -n "${{ github.event.inputs.suffix }}" ]]; then
bundle exec fastlane adhoc suffix:${{ github.event.inputs.suffix }}
else
bundle exec fastlane adhoc
fi
- name: Set filenames
run: |
echo "ipa_filename=${{ env.output_name }}.ipa" >> $GITHUB_ENV
echo "dsyms_filename=${{ env.output_name }}.app.dSYM.zip" >> $GITHUB_ENV
- name: Set paths
run: |
echo "ipa_path=${{ github.workspace }}/${{ env.ipa_filename }}" >> $GITHUB_ENV
echo "dsyms_path=${{ github.workspace }}/${{ env.dsyms_filename }}" >> $GITHUB_ENV
- name: Upload IPA artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ipa_filename }}
path: ${{ env.ipa_path }}
- name: Upload dSYMs artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.dsyms_filename }}
path: ${{ env.dsyms_path }}
- name: Get Asana Task ID
id: get-task-id
if: github.event.inputs.asana-task-url
run: |
task_url_regex='^https://app.asana.com/[0-9]/[0-9]*/([0-9]*)/f$'
if [[ "${{ github.event.inputs.asana-task-url }}" =~ ${task_url_regex} ]]; then
echo "task_id=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
else
echo "::error::Asana Task URL has incorrect format (attempted to match ${task_url_regex})."
fi
- name: Upload IPA to Asana
if: github.event.inputs.asana-task-url
env:
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
run: |
curl -s "https://app.asana.com/api/1.0/tasks/${{ steps.get-task-id.outputs.task_id }}/attachments" \
-H "Authorization: Bearer ${{ secrets.ASANA_ACCESS_TOKEN }}" \
--form "file=@${{ env.ipa_path }};type=application/zip"