-
-
Notifications
You must be signed in to change notification settings - Fork 82
137 lines (121 loc) · 4.44 KB
/
build.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
name: Create Beta Build
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build:
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: ${{ secrets.B_BR }}
path: "Bbuild"
token: ${{ secrets.B_GH_TOKEN }}
- name: Install dependencies (packages)
run: |
curl -LO https://github.com/ProcursusTeam/ldid/releases/download/v2.1.5-procursus7/ldid_macosx_x86_64
sudo install -m755 ldid_macosx_x86_64 /usr/local/bin/ldid
brew install 7zip gnu-sed
- name: Select Xcode 16
run: |
sudo xcode-select -s /Applications/Xcode_16.app/Contents/Developer
mkdir upload
sed -i '' '/func application(/a\
Preferences.beta = true
' iOS/Delegates/AppDelegate.swift
- name: Compile f
run: |
$GITHUB_WORKSPACE/Bbuild/prep.sh
make package SCHEME="'feather (Release)'"
mv packages/* upload/
- name: Install pyupload
run: |
pip install pyupload
- name: Upload file to Catbox
id: upload_catbox
run: |
UPLOAD_OUTPUT=$(pyupload upload/feather.ipa --host=catbox)
echo "Upload Output: $UPLOAD_OUTPUT"
LINK=$(echo "$UPLOAD_OUTPUT" | sed -n 's/.*Your link : //p')
echo "Uploaded file link: $LINK"
echo "catbox_link=$LINK" >> $GITHUB_ENV
- name: Update Bbuild
run: |
updated_at=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
size=12375230
version=${{ github.run_number }}
download_url=${{ env.catbox_link }}
if [ -n "$download_url" ]; then
echo "Download URL for .ipa file: $download_url"
echo "Updated at: $updated_at"
echo "Size: $size bytes"
echo "Version: $version"
jq --arg version "$version" \
--arg date "$updated_at" \
--argjson size "$size" \
--arg url "$download_url" \
'.apps[0].size = $size |
.apps[0].version = $version |
.apps[0].versionDate = $date |
.apps[0].downloadURL = $url |
.apps[0].versions = (
[{
version: $version,
date: $date,
size: $size,
downloadURL: $url
}] + .apps[0].versions
) | .apps[0].versions |= unique_by(.version)' $GITHUB_WORKSPACE/Bbuild/b.json > $GITHUB_WORKSPACE/Bbuild/updated_b.json
mv $GITHUB_WORKSPACE/Bbuild/updated_b.json $GITHUB_WORKSPACE/Bbuild/b.json
else
echo "missing information."
echo "Updated at: $updated_at"
echo "Version: $version"
fi
- name: Push builds
run: |
cd $GITHUB_WORKSPACE/Bbuild
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add .
git commit -m "Build $GITHUB_SHA" || exit 0
git push
- name: Send Discord build message
run: |
COMMIT_HASH=$(git log -1 --pretty=format:'%h') &&
COMMIT_MESSAGE=$(git log -1 --pretty=format:'%s') &&
(
curl "${{ secrets.B_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d '{
"content":null,
"embeds":[
{
"title":"${{ github.repository }} [Build ${{ github.run_number }}]",
"description":"[`'"$COMMIT_HASH"'`](https://github.com/${{ github.repository }}/commit/'"$COMMIT_HASH"') '"$COMMIT_MESSAGE"'",
"url":"https://github.com/${{ github.repository }}/actions/runs/${GITHUB_RUN_ID}",
"color":6648790,
"author":{
"name":"${{ github.actor }}",
"icon_url":"https://github.com/${{ github.actor }}.png"
}
}
],
"attachments":[],
"components":[
{
"type":1,
"components":[
{
"type":2,
"url":"${{ env.catbox_link }}",
"label":"Download",
"style":5
}
]
}
]
}' || true
)