test3 #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |