From d7d529c6623415ef4de2df4a8a319901d2ead6b4 Mon Sep 17 00:00:00 2001 From: Soham Banerjee Date: Tue, 11 Aug 2020 00:54:19 +0530 Subject: [PATCH 1/3] Add GitHub CD config --- .github/workflows/main.yml | 69 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..492173e --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,69 @@ +name: CD + +on: + push: + branches: master + +env: + BUILD_OUTPUT: 'build/Build/Products/Catalina/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)" + sed -i '' -e "s/CURRENT_PROJECT_VERSION =.*/CURRENT_PROJECT_VERSION = ${GIT_SHA};/g" Black80211.xcodeproj/project.pbxproj + eval $(grep -m 1 "MARKETING_VERSION =" Black80211.xcodeproj/project.pbxproj | tr -d ';' | tr -d '\t' | tr -d " ") + echo "::set-env name=SHORT_SHA::$GIT_SHA" + echo "::set-env name=BLACK80211_VER::$MARKETING_VERSION" + if [[ -z $CUR_TAG ]]; then + echo "::set-env name=OLD_PRE_TAG::NULL" + else + echo "::set-env name=OLD_PRE_TAG::$CUR_TAG" + fi + + - 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 '### The latest five updates are:' >> ReleaseNotes.md + git log -"5" --format="- %H %s" | sed '/^$/d' >> ReleaseNotes.md + + - name: Build Black80211 + run: | + xcodebuild -scheme Black80211_Catalina -configuration Debug -sdk macosx10.15 -derivedDataPath build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty && exit ${PIPESTATUS[0]} + + - name: Pack Artifacts + run: | + cd $BUILD_OUTPUT + zip -r Black80211-v${BLACK80211_VER}-DEBUG-alpha-${SHORT_SHA}.zip Black80211.kext + cd - + + - name: Delete Old Prerelease + uses: dev-drprasad/delete-tag-and-release@v0.1.2 + with: + tag_name: ${{ env.OLD_PRE_TAG }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish GitHub Release + uses: ncipollo/release-action@v1 + with: + prerelease: true + bodyFile: ReleaseNotes.md + artifacts: "${{ env.BUILD_OUTPUT }}/*.zip" + tag: "v${{ env.BLACK80211_VER }}-alpha" + token: ${{ secrets.GITHUB_TOKEN }} From de1b97384f851da280890ae6006924f74bf08da7 Mon Sep 17 00:00:00 2001 From: Soham Banerjee Date: Tue, 11 Aug 2020 00:56:14 +0530 Subject: [PATCH 2/3] Add MARKETING_VERSION for CD --- Black80211.xcodeproj/project.pbxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Black80211.xcodeproj/project.pbxproj b/Black80211.xcodeproj/project.pbxproj index 97f39d1..1b344d3 100644 --- a/Black80211.xcodeproj/project.pbxproj +++ b/Black80211.xcodeproj/project.pbxproj @@ -225,6 +225,7 @@ ); INFOPLIST_FILE = Black80211/Info.plist; MACOSX_DEPLOYMENT_TARGET = 10.15; + MARKETING_VERSION = 1.0.0d1; MODULE_NAME = net.rpeshkov.Black80211; MODULE_VERSION = 1.0.0d1; ONLY_ACTIVE_ARCH = YES; @@ -250,6 +251,7 @@ ); INFOPLIST_FILE = Black80211/Info.plist; MACOSX_DEPLOYMENT_TARGET = 10.15; + MARKETING_VERSION = 1.0.0d1; MODULE_NAME = net.rpeshkov.Black80211; MODULE_VERSION = 1.0.0d1; ONLY_ACTIVE_ARCH = YES; From fe36d3338413986dfe31170c75facd846cf50642 Mon Sep 17 00:00:00 2001 From: Soham Banerjee Date: Wed, 12 Aug 2020 23:54:29 +0530 Subject: [PATCH 3/3] Modify workflow for Big Sur --- .github/workflows/main.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 492173e..51c5219 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,8 @@ on: branches: master env: - BUILD_OUTPUT: 'build/Build/Products/Catalina/Debug' + BUILD_OUTPUT_CATALINA: 'build/Build/Products/Debug/Catalina' + BUILD_OUTPUT_BIG_SUR: 'build/Build/Products/Debug/Big Sur' jobs: @@ -42,14 +43,24 @@ jobs: echo '### The latest five updates are:' >> ReleaseNotes.md git log -"5" --format="- %H %s" | sed '/^$/d' >> ReleaseNotes.md - - name: Build Black80211 + - name: Build Black80211 (Catalina) run: | - xcodebuild -scheme Black80211_Catalina -configuration Debug -sdk macosx10.15 -derivedDataPath build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty && exit ${PIPESTATUS[0]} + xcodebuild -scheme Catalina -configuration Debug -sdk macosx10.15 -derivedDataPath build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty && exit ${PIPESTATUS[0]} - - name: Pack Artifacts + - name: Pack Artifacts (Catalina) run: | - cd $BUILD_OUTPUT - zip -r Black80211-v${BLACK80211_VER}-DEBUG-alpha-${SHORT_SHA}.zip Black80211.kext + cd "$BUILD_OUTPUT_CATALINA" + zip -r Black80211-v${BLACK80211_VER}-Catalina-DEBUG-alpha-${SHORT_SHA}.zip Black80211.kext + cd - + + - name: Build Black80211 (Big Sur) + run: | + xcodebuild -scheme 'Big Sur' -configuration Debug -sdk macosx10.15 -derivedDataPath build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty && exit ${PIPESTATUS[0]} + + - name: Pack Artifacts (Big Sur) + run: | + cd "$BUILD_OUTPUT_BIG_SUR" + zip -r Black80211-v${BLACK80211_VER}-Big-Sur-DEBUG-alpha-${SHORT_SHA}.zip Black80211.kext cd - - name: Delete Old Prerelease @@ -64,6 +75,6 @@ jobs: with: prerelease: true bodyFile: ReleaseNotes.md - artifacts: "${{ env.BUILD_OUTPUT }}/*.zip" + artifacts: "${{ env.BUILD_OUTPUT_CATALINA }}/*.zip,${{ env.BUILD_OUTPUT_BIG_SUR }}/*.zip" tag: "v${{ env.BLACK80211_VER }}-alpha" token: ${{ secrets.GITHUB_TOKEN }}