Skip to content

Commit

Permalink
Simplify version getting/setting
Browse files Browse the repository at this point in the history
  • Loading branch information
homebysix committed Jun 9, 2023
1 parent 7019d15 commit a2e20b2
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ jobs:
- name: Build and analyze bundle
run: |
xcodebuild -project "Escrow Buddy/Escrow Buddy.xcodeproj" clean build analyze -configuration Release
/usr/libexec/PlistBuddy -c "Print:CFBundleShortVersionString" "Escrow Buddy/build/Release/Escrow Buddy.bundle/Contents/Info.plist" > "Escrow Buddy/build/version.txt"
- name: get environment variables
id: get_env_var
- name: Set environment variables
id: set_env_var
run: |
echo "THIS_VERSION=$(/bin/cat ./build_info.txt)" >> $GITHUB_ENV
echo "VERSION=$(/usr/libexec/PlistBuddy -c "Print:CFBundleShortVersionString" "Escrow Buddy/build/Release/Escrow Buddy.bundle/Contents/Info.plist")" >> $GITHUB_ENV
- name: Build installer package
run: |
Expand All @@ -45,14 +44,14 @@ jobs:
cp -R "Escrow Buddy/build/Release/Escrow Buddy.bundle" "$PKGROOT/Library/Security/SecurityAgentPlugins/Escrow Buddy.bundle"
pkgbuild --root "$PKGROOT" \
--identifier com.netflix.Escrow-Buddy \
--version "${{ env.THIS_VERSION }}" \
--version "${{ env.VERSION }}" \
--scripts scripts/pkg \
"Escrow Buddy/build/Escrow Buddy-${{ env.THIS_VERSION }}-unsigned.pkg"
"Escrow Buddy/build/Escrow Buddy-${{ env.VERSION }}-unsigned.pkg"
- name: Sign package
run: |
productsign --sign "Developer ID Installer: Mac Admins Open Source (T4SK8ZXCXG)" \
"Escrow Buddy/build/Escrow Buddy-${{ env.THIS_VERSION }}-unsigned.pkg" "Escrow Buddy/build/Escrow Buddy-${{ env.THIS_VERSION }}-signed.pkg"
"Escrow Buddy/build/Escrow Buddy-${{ env.VERSION }}-unsigned.pkg" "Escrow Buddy/build/Escrow Buddy-${{ env.VERSION }}-signed.pkg"
- name: Notarize package
run: |
Expand All @@ -63,13 +62,13 @@ jobs:
--password "${{ secrets.NOTARY_APP_PASSWORD_MAOS }}" \
default
"$XCODE_PATH/Contents/Developer/usr/bin/notarytool" submit \
"Escrow Buddy/build/Escrow Buddy-${{ env.THIS_VERSION }}-signed.pkg" \
"Escrow Buddy/build/Escrow Buddy-${{ env.VERSION }}-signed.pkg" \
--keychain-profile "default" \
--wait
"$XCODE_PATH/Contents/Developer/usr/bin/stapler" staple \
"Escrow Buddy/build/Escrow Buddy-${{ env.THIS_VERSION }}-signed.pkg"
"Escrow Buddy/build/Escrow Buddy-${{ env.VERSION }}-signed.pkg"
mkdir -p artifacts
/bin/mv "Escrow Buddy/build/Escrow Buddy-${{ env.THIS_VERSION }}-signed.pkg" "artifacts/Escrow Buddy-${{ env.THIS_VERSION }}.pkg"
/bin/mv "Escrow Buddy/build/Escrow Buddy-${{ env.VERSION }}-signed.pkg" "artifacts/Escrow Buddy-${{ env.VERSION }}.pkg"
- name: Upload packages
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
Expand Down

0 comments on commit a2e20b2

Please sign in to comment.