-
Notifications
You must be signed in to change notification settings - Fork 2
93 lines (88 loc) · 2.62 KB
/
build.yaml
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
on: push
jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip-ci')"
runs-on: macos-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
-
name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true
-
name: Update submodules
run: |
git pull --recurse-submodules
git submodule update --remote --recursive
-
name: Setup Theos
uses: beerpiss/[email protected]
-
name: Patching files
run: |
cd /Users/runner/work/tweaks/tweaks
find patches/ -type f -iname *.patch -exec /bin/bash -c '
patchfile=$1;
orig_file=${patchfile#patches/}
orig_file=${orig_file%.patch}
orig_file=${orig_file#/}
patch $orig_file $patchfile
' bash '{}' \;
-
name: Build packages
run: |
mkdir output
find . -maxdepth 1 -not -path . -type d \
-not -name "patches" \
-not -name '.git' \
-not -name 'theos' \
-not -name 'LICENSE' \
-exec make -C '{}' package FINALPACKAGE=1 \;
find . -type f -iname *.deb -exec mv '{}' output \;
-
name: Upload artifacts
uses: actions/upload-artifact@v2
with:
path: output/*
upload-prerelease:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' # Only upload prereleases when it gets merged to main
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Download artifacts
uses: actions/download-artifact@v2
-
name: Get version information
run: |
echo "todayDate=$(date +%Y%m%dT%H%M%SZ)" >> $GITHUB_ENV
-
name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.todayDate }}
release_name: Prerelease ${{ env.todayDate }}
draft: false
prerelease: true
-
name: Attach binaries to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
todayDate: ${{ env.todayDate }}
version: ${{ env.version }}
name: ${{ env.name }}
run: |
set -x
assets=()
for asset in ./artifact/*; do
assets+=("-a" "$asset")
done
hub release edit "${assets[@]}" -m "Prerelease $todayDate" $todayDate