-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (62 loc) · 2.29 KB
/
release.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
name: Release
on:
workflow_dispatch:
env:
GH_TOKEN: ${{ github.token }}
jobs:
build-tweak-and-release:
runs-on: macos-14
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Prepare Theos
uses: Randomblock1/theos-action@v1
- name: Clone YouTubeHeader
run: |
git clone https://github.com/PoomSmart/YouTubeHeader $THEOS/include/YouTubeHeader
- name: Build packages
run: make package FINALPACKAGE=1
- name: Extract Values
run: |
NAME=$(grep '^Name:' control | cut -d ' ' -f 2)
echo "NAME=$NAME" >> $GITHUB_ENV
PACKAGE=$(grep '^Package:' control | cut -d ' ' -f 2)
VERSION=$(grep '^Version:' control | cut -d ' ' -f 2)
echo "VERSION=$VERSION" >> $GITHUB_ENV
ROOTLESS_DEB_FILE_NAME="${PACKAGE}_${VERSION}_iphoneos-arm64.deb"
echo "ROOTLESS_DEB_FILE_NAME=$ROOTLESS_DEB_FILE_NAME" >> $GITHUB_ENV
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.VERSION }}
files: |
.theos/obj/${{ env.NAME }}.dylib
packages/${{ env.ROOTLESS_DEB_FILE_NAME }}
generate_release_notes: true
fail_on_unmatched_files: true
token: ${{ env.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update Repository
uses: actions/github-script@v7
with:
github-token: ${{ secrets.REPO_ACCESS_TOKEN }}
script: |
const assets = JSON.parse('${{ steps.create_release.outputs.assets }}');
const debAsset = assets.find(asset => asset.name === '${{ env.ROOTLESS_DEB_FILE_NAME }}');
if (!debAsset) {
core.setFailed('Could not find DEB asset in release');
return;
}
await github.rest.repos.createDispatchEvent({
owner: 'castdrian',
repo: 'apt-repo',
event_type: 'package-update',
client_payload: {
package_url: debAsset.browser_download_url,
package_name: '${{ env.ROOTLESS_DEB_FILE_NAME }}'
}
});