钉钉机器人
curl 'https://oapi.dingtalk.com/robot/send?access_token=8c022fd6586126b80994e1b551ce31ab6ee56ed045c47c51c8ab0192c723cb1e' \
-H 'Content-Type: application/json' \
-d '{
"msgtype": "text",
"text": {
"content": "高考iOS最新安装包 ipa--https://fir.im/lgk"
},
"at": {
"atMobiles": [
"15718808963",
"13241411941",
"13466778405",
"13716307872"
],
"isAtAll": false
}
}'
参数说明:
参数 | 参数类型 | 必须 | 说明 |
---|---|---|---|
msgtype | String | 是 | 消息类型,此时固定为:text |
content | String | 是 | 消息内容 |
atMobiles | Array | 否 | 被@人的手机号(在content里添加@人的手机号) |
isAtAll | bool | 否 | @所有人时:true,否则为:false |
#!/bin/sh
# -----------------> 基本信息配置区
# 工程名称
kProjectName="ipa.xcodeproj"
# scheme名称
kSchemeName="ipa"
# target 这里scheme只对应了一个target运行;如果有多个target需要制定target
kTargetName="ipa"
# APP环境配置
kConfiguration="Release"
# archive导出路径
kArchivePath="./ipaOutput/${kSchemeName}.xcarchive"
# ipa导出路径
kExport_ipa_Path="./ipaOutput/${kSchemeName}"
# 不同的打包方式这个导出文件不同
kExportOptionsPlist="./ipaOutput/ExportOptions.plist"
kAppChangelog="kael-我是版本更新信息"
# ------------------> 打包区
# clean
xcodebuild clean -configuration "$configuration" -alltargets
# archive project
xcodebuild archive -project "$kProjectName" -scheme "$kSchemeName" -configuration "$kConfiguration" -archivePath "$kArchivePath"
# archive workspace
# #xcodebuild archive -workspace "$workspaceName" -scheme "$scheme" -configuration "$kConfiguration" -archivePath "$kArchivePath"
# 导出ipa
xcodebuild -exportArchive -archivePath "$kArchivePath" -exportOptionsPlist "$kExportOptionsPlist" -exportPath "$kExport_ipa_Path"
# --------------> 检测IPA存在否
ipa_path="${kExport_ipa_Path}/${kSchemeName}.ipa"
if [ -f "$ipa_path" ]
then
echo "------------ipa存在😁......"
else
echo "------------ipa不存在😭......"
exit 1
fi
# --------- firm 上传配置
echo "请选择登录账户名:\n 1)kael 自己的fir账户(默认) \n 2)公司的fir账户"
read fir_token
if [[ $fir_token == 2 ]]; then
#公司账号
fir_token="bab4a513ef576e49dceb3abe9e9b028a"
else
# 自己的账号
fir_token="b3bb54eca50a2545d0a6044cb19a616a"
fi
# 钉钉机器人🤖
DD_access_token="8c022fd6586126b80994e1b551ce31ab6ee56ed045c47c51c8ab0192c723cb1e"
fir publish ${ipa_path} -T $fir_token -c $kAppChangelog -D $DD_access_token
# -------- pgy 上传
echo "------------准备发布蒲公英------------"
#>>>>>>>>>>>蒲公英
#蒲公英账号
pgy_API_Key="ed34bd49e37a2a2943918d18b1489a71"
pgy_User_Key="878381aa4356d997c1c4c7bb27649807"
#蒲公英发布
curl -F "file=@$ipa_path" \
-F "uKey=$pgy_User_Key" \
-F "_api_key=$pgy_API_Key" \
-F "updateDescription=$kAppChangelog" \
https://www.pgyer.com/apiv1/app/upload
#钉钉群通知相关人员
curl 'https://oapi.dingtalk.com/robot/send?access_token=8c022fd6586126b80994e1b551ce31ab6ee56ed045c47c51c8ab0192c723cb1e' \
-H 'Content-Type: application/json' \
-d '{
"msgtype": "text",
"text": {
"content": "高考iOS最新安装包 ipa"
},
"at": {
"atMobiles": [
"15718808963",
"13241411941",
"13466778405",
"13716307872"
],
"isAtAll": false
}
}'