forked from OpenIntelWireless/itlwm
-
Notifications
You must be signed in to change notification settings - Fork 3
81 lines (66 loc) · 2.83 KB
/
main.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
name: CD
on:
push:
branches: master
env:
BUILD_OUTPUT: 'build/Build/Products/Debug'
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '5'
- name: Manage Version
run: |
git fetch --prune --unshallow --tags
GIT_SHA="$(git rev-parse --short HEAD)"
CUR_TAG="$(git tag -l | grep 'alpha\|beta' | tail -1)"
eval $(grep -m 1 "MODULE_VERSION =" itlwm.xcodeproj/project.pbxproj | tr -d ';' | tr -d '\t' | tr -d " ")
echo "SHORT_SHA=$GIT_SHA" >> $GITHUB_ENV
echo "ITLWM_VER=$MODULE_VERSION" >> $GITHUB_ENV
if [[ -z $CUR_TAG ]]; then
echo "OLD_PRE_TAG=NULL" >> $GITHUB_ENV
else
echo "OLD_PRE_TAG=$CUR_TAG" >> $GITHUB_ENV
fi
- name: Install MacKernelSDK
run: |
git clone --depth=1 https://github.com/acidanthera/MacKernelSDK.git
- name: Build itlwm
run: |
xcodebuild -scheme itlwm -configuration Debug -derivedDataPath build GIT_COMMIT=_${SHORT_SHA} | xcpretty && exit ${PIPESTATUS[0]}
- name: Build AirportItlwm
run: |
xcodebuild -scheme "AirportItlwm (all)" -configuration Debug -derivedDataPath build GIT_COMMIT=_${SHORT_SHA} | xcpretty && exit ${PIPESTATUS[0]}
- name: Pack Artifacts
run: |
cd $BUILD_OUTPUT
zip -r itlwm-v${ITLWM_VER}-DEBUG-alpha-${SHORT_SHA}.zip itlwm.kext
while read -r tgt ; do
zip -r AirportItlwm-${tgt// /_}-v${ITLWM_VER}-DEBUG-alpha-${SHORT_SHA}.zip "$tgt"
done < <(find . -mindepth 1 -maxdepth 1 -type d -not -path "*.kext" | cut -c 3-)
cd -
- name: Generate Prerelease Release Notes
run: |
echo '### Disclaimer:' >> ReleaseNotes.md
echo '***This alpha version is for testing only.***' >> ReleaseNotes.md
echo 'It is not ready for daily use and we do not guarantee its usability.' >> ReleaseNotes.md
echo 'If you discovered an issue and you do not have debugging skills, please check with the [Gitter Chat Room](https://gitter.im/OpenIntelWireless/itlwm) in advance before opening an Issue.' >> ReleaseNotes.md
echo '### The latest five updates are:' >> ReleaseNotes.md
git log -"5" --format="- %H %s" | sed '/^$/d' >> ReleaseNotes.md
- name: Delete Old Prerelease
uses: dev-drprasad/delete-tag-and-release@v0.2.1
with:
tag_name: ${{ env.OLD_PRE_TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish GitHub Release
if: contains(github.event.head_commit.message, 'Bump version') == false
uses: ncipollo/release-action@v1.12.0
with:
prerelease: true
bodyFile: ReleaseNotes.md
artifacts: "${{ env.BUILD_OUTPUT }}/*.zip"
tag: "v${{ env.ITLWM_VER }}-alpha"
token: ${{ secrets.GITHUB_TOKEN }}