-
Notifications
You must be signed in to change notification settings - Fork 2
/
bitrise.yml
107 lines (92 loc) · 3.51 KB
/
bitrise.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
format_version: "6"
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: ios
trigger_map:
- tag: '*.*.*'
workflow: release-to-cocoapods
workflows:
post-release:
steps:
- activate-ssh-key@4: {}
- git-clone@8: {}
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully
set -o pipefail
# debug log
set -x
should_check_checksum=false
checksum=""
version=""
while IFS= read -r line; do
if [[ $line == *"GliaCoreSDK.xcframework.zip"* ]]; then
should_check_checksum=true
search_string="releases/download/"
# Get the string after the search string
trailing_string=${line#*$search_string}
# Splice the string to get the version number
version=${trailing_string:0:5}
fi
if [[ $line == *"checksum:"* ]] && [ $should_check_checksum == true ]; then
separator=': "'
# Because the string has spaces, the separator must be set to IFS.
IFS=$separator
# Split the string into a list.
split_string=(${line//$separator/ })
# Get the second value, in this case, the checksum.
checksum=${split_string[1]}
should_check_checksum=false
unset IFS
# Nothing else is needed, so the while is broken.
break
fi
done < "Package.swift"
envman add --key NEW_VERSION --value "$version"
envman add --key NEW_CHECKSUM --value "$checksum"
echo "New version will be $version and checksum $checksum"
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully
set -o pipefail
# debug log
set -x
curl https://app.bitrise.io/app/$IOS_SDK_WIDGETS_APP_SLUG/build/start.json -L --data \
'{
"hook_info": {
"type": "bitrise",
"build_trigger_token": "'"$IOS_SDK_WIDGETS_BUILD_TRIGGER_TOKEN"'"
},
"build_params": {
"branch": "development",
"workflow_id": "update_dependencies",
"environments": [{
"mapped_to": "CHECKSUM",
"value": "'"$NEW_CHECKSUM"'",
"is_expand": false
}, {
"mapped_to": "VERSION",
"value": "'"$NEW_VERSION"'",
"is_expand": false
}]
},
"triggered_by":"curl"
}'
release-to-cocoapods:
steps:
- activate-ssh-key@4: {}
- git-clone@6: {}
- script:
inputs:
- content: pod trunk push GliaCoreSDK.podspec --verbose
meta:
bitrise.io:
stack: osx-xcode-14.2.x-ventura
machine_type_id: g2-m1.4core