Skip to content

Commit

Permalink
make a new beta release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
erikng committed Feb 26, 2024
1 parent ed30627 commit 2df6699
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build_munki.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Munki (Manual)
name: Build Munki Release (Manual)

env:
APP_SIGNING_IDENTITY: "Developer ID Application: Mac Admins Open Source (T4SK8ZXCXG)"
Expand All @@ -15,13 +15,13 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
path: munki-builds

- name: Checkout munki repo
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
path: munki
Expand Down Expand Up @@ -72,10 +72,10 @@ jobs:
id: create_release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
name: Munki v${{env.MUNKI_VERSION}} Beta
name: Munki v${{env.MUNKI_VERSION}}
tag_name: v${{env.MUNKI_VERSION}}
draft: false
prerelease: true
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
body: |
This is a signed and notarized build of munki
Expand Down
82 changes: 82 additions & 0 deletions .github/workflows/build_munki_beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Build Munki Beta Release (Manual)

env:
APP_SIGNING_IDENTITY: "Developer ID Application: Mac Admins Open Source (T4SK8ZXCXG)"
INSTALLER_SIGNING_IDENTITY: "Developer ID Installer: Mac Admins Open Source (T4SK8ZXCXG)"
NOTARY_APP_PASSWORD: ${{ secrets.NOTARY_APP_PASSWORD_MAOS }}
REVISION: 9e541a8e1a4ccd8df54df03c6e5495ebdb23b6f3 # hardcoded for now until we figure out how we want to tackle this - v6.5.0b1
XCODE_PATH: "/Applications/Xcode_15.2.app"

on: [workflow_dispatch]

jobs:
build:
runs-on: macos-13

steps:
- name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
path: munki-builds

- name: Checkout munki repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
path: munki
ref: ${{env.REVISION}}
repository: munki/munki

- name: Install Apple Xcode certificates
uses: apple-actions/import-codesign-certs@8f3fb608891dd2244cdab3d69cd68c0d37a7fe93 # v2.0.0
with:
keychain-password: ${{ github.run_id }}
p12-file-base64: ${{ secrets.APP_CERTIFICATES_P12_MAOS }}
p12-password: ${{ secrets.APP_CERTIFICATES_P12_PASSWORD_MAOS }}

- name: Install Apple Installer certificates
uses: apple-actions/import-codesign-certs@8f3fb608891dd2244cdab3d69cd68c0d37a7fe93 # v2.0.0
with:
create-keychain: false # do not create a new keychain for this value
keychain-password: ${{ github.run_id }}
p12-file-base64: ${{ secrets.PKG_CERTIFICATES_P12_MAOS }}
p12-password: ${{ secrets.PKG_CERTIFICATES_P12_PASSWORD_MAOS }}

- name: Set Xcode Version
run: sudo xcode-select -s "$XCODE_PATH"

- name: Build munki package
run: |
cd ./munki
./code/tools/make_munki_mpkg.sh -p -S "$APP_SIGNING_IDENTITY" -s "$INSTALLER_SIGNING_IDENTITY"
echo "MUNKI_PKG_PATH=$(find . -type f -name "*.pkg")" >> $GITHUB_ENV
echo "MUNKI_VERSION=$(find . -type f -name "*.pkg" | sed 's/[^\-]*-//' | sed 's/\.[^.]*$//')" >> $GITHUB_ENV
- name: Notarize and staple package
id: notarize_and_staple
run: |
"$XCODE_PATH/Contents/Developer/usr/bin/notarytool" store-credentials --apple-id "[email protected]" --team-id "T4SK8ZXCXG" --password "$NOTARY_APP_PASSWORD" munki
"$XCODE_PATH/Contents/Developer/usr/bin/notarytool" submit "./munki/$MUNKI_PKG_PATH" --keychain-profile "munki" --wait
"$XCODE_PATH/Contents/Developer/usr/bin/stapler" staple "./munki/$MUNKI_PKG_PATH"
- name: Generate changelog
if: ${{ false }} # disable job or now
id: changelog
uses: metcalfc/changelog-generator@afdcb9470aebdb2252c0c95a1c130723c9e21f3a # v4.1
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
reverse: 'true'

- name: Create Release
id: create_release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
name: Munki v${{env.MUNKI_VERSION}} Beta
tag_name: v${{env.MUNKI_VERSION}}
draft: false
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}
body: |
This is a signed and notarized build of munki betas
files: ${{github.workspace}}/munki/*.pkg

0 comments on commit 2df6699

Please sign in to comment.