-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (137 loc) · 5.28 KB
/
Copy pathbuild.yml
File metadata and controls
144 lines (137 loc) · 5.28 KB
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
name: Xcode - Build
on:
push:
pull_request:
workflow_dispatch:
inputs:
release__nightly:
description: Create a nightly release
type: boolean
required: false
jobs:
build:
name: Build using xcodebuild command
runs-on: macos-latest
env:
scheme: LiveContainer
archive_path: archive
outputs:
scheme: ${{ steps.scheme.outputs.scheme }}
archive_path: ${{ env.archive_path }}
artifact: ${{ env.scheme }}.ipa
artifact2: ${{ env.scheme }}+SideStore.ipa
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '26.2'
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set Scheme
id: scheme
run: |
if [ $scheme = default ]
then
scheme_list=$(xcodebuild -list -json | tr -d "\n")
scheme=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]")
echo Using default scheme: $scheme
else
echo Using configured scheme: $scheme
fi
echo "scheme=$scheme" >> $GITHUB_OUTPUT
- name: Set filetype_parameter
id: filetype_parameter
run: |
filetype_parameter=`ls -A | grep -i \\.xcworkspace\$ && echo workspace || echo project`
echo "filetype_parameter=$filetype_parameter" >> $GITHUB_OUTPUT
- name: Set file_to_build
id: file_to_build
run: |
file_to_build=`ls -A | grep -i \\.xcworkspace\$ || ls -A | grep -i \\.xcodeproj\$`
file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
echo "file_to_build=$file_to_build" >> $GITHUB_OUTPUT
- name: Archive
env:
scheme: ${{ steps.scheme.outputs.scheme }}
filetype_parameter: ${{ steps.filetype_parameter.outputs.filetype_parameter }}
file_to_build: ${{ steps.file_to_build.outputs.file_to_build }}
run: xcodebuild archive -archivePath "$archive_path" -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -sdk iphoneos -arch arm64 -configuration Release | xcpretty && exit ${PIPESTATUS[0]}
- name: Tar Build Artifact
run: tar -cvf "$archive_path.xcarchive.tar" "$archive_path.xcarchive"
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.archive_path }}.xcarchive.tar
path: ${{ env.archive_path }}.xcarchive.tar
- name: Create IPA
run: |
sh .github/build_github.sh
- name: Upload a Build Artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.scheme }}.ipa
path: ${{ env.scheme }}.ipa
- name: Upload LiveContainer+SideStore
uses: actions/upload-artifact@v7
with:
name: ${{ env.scheme }}+SideStore.ipa
path: ${{ env.scheme }}+SideStore.ipa
release__nightly:
name: Nightly Release
permissions:
contents: write
if: inputs.release__nightly || github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
runs-on: ubuntu-latest
needs: [build]
concurrency:
group: release__nightly
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download a Build Artifact
uses: actions/download-artifact@v8
with:
name: ${{ needs.build.outputs.artifact }}
- name: Download a Build Artifact2
uses: actions/download-artifact@v8
with:
name: ${{ needs.build.outputs.artifact2 }}
- name: Get Commit Info
id: commit_info
run: |
COMMIT_SHA=$(git rev-parse HEAD)
COMMIT_MSG=$(git log -1 --pretty=%s)
echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV
echo "COMMIT_MSG=$COMMIT_MSG" >> $GITHUB_ENV
- name: Update AltStore source
id: update_source
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NIGHTLY_LINK: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}
commit_sha: ${{ env.COMMIT_SHA }}
commit_msg: ${{ env.COMMIT_MSG }}
run: |
python .github/update_json.py
- name: Nightly Release
uses: andelf/nightly-release@5834076edc55cc05975561c9722043f072ac5c26
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: |
**Commit:** [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
**Message:** ${{ github.event.head_commit.message }}
This is a nightly release [created automatically with GitHub Actions workflow](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}).
files: |
${{ needs.build.outputs.artifact }}
${{ needs.build.outputs.artifact2 }}
.github/apps_nightly.json
- name: Update apps.json in Release 1.0
uses: softprops/action-gh-release@v3
with:
tag_name: "1.0"
files: |
.github/apps_ss_lc.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}