Skip to content

1.9 (10)

1.9 (10) #32

Workflow file for this run

name: "Release"
on:
push:
tags:
- "*.*"
jobs:
release:
name: "Release"
runs-on: macos-12
permissions:
contents: write
steps:
- name: "Checkout"
uses: actions/checkout@v1
- name: "Configure certificates"
run: >
echo $DISTRIBUTION_CERT_BASE_64 | base64 --decode > cert.p12 &&
security create-keychain -p $KEYCHAIN_PASS $KEYCHAIN &&
security default-keychain -s ~/Library/Keychains/$KEYCHAIN-db &&
security set-keychain-settings $KEYCHAIN &&
security list-keychains -s $KEYCHAIN &&
security list-keychains &&
security unlock-keychain -p $KEYCHAIN_PASS $KEYCHAIN &&
security import ./cert.p12 -k $KEYCHAIN -P $DISTRIBUTION_CERT_PASS -A -T /usr/bin/codesign -T /usr/bin/security &&
security set-key-partition-list -S apple-tool:,apple: -s -k $KEYCHAIN_PASS $KEYCHAIN &&
security find-identity -p codesigning -v
env:
KEYCHAIN: "def.keychain"
KEYCHAIN_PASS: "hmmmm"
DISTRIBUTION_CERT_BASE_64: ${{ secrets.DISTRIBUTION_CERT_BASE_64 }}
DISTRIBUTION_CERT_PASS: ${{ secrets.DISTRIBUTION_CERT_PASS }}
- name: "Configure notarytool"
run: >
xcrun notarytool store-credentials notarytool --apple-id $APPLE_ID --team-id $TEAM_ID --password $NOTARY_TOOL_PASS
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
NOTARY_TOOL_PASS: ${{ secrets.NOTARY_TOOL_PASS }}
TEAM_ID: ${{ secrets.TEAM_ID }}
- name: "Archive"
run: xcodebuild -project MiddleMe.xcodeproj -scheme MiddleMe -configuration Release archive -archivePath middleme.xcarchive
- name: "Zip App"
run: pushd middleme.xcarchive/Products/Applications && zip --symlinks -r ../../../MiddleMe.zip MiddleMe.app && popd
- name: "Notarize app"
run: xcrun notarytool submit MiddleMe.zip --keychain-profile notarytool --wait
- name: "Create cask env"
run: |
SHA=$(shasum -a 256 MiddleMe.zip | awk '{print $1}') && \
echo "ARTEFACT_SHA256=$(echo $SHA)" >> cask.env && \
VERSION=$(sed -n '/MARKETING_VERSION/{s/MARKETING_VERSION = //;s/;//;s/^[[:space:]]*//;p;q;}' ./MiddleMe.xcodeproj/project.pbxproj) && \
echo "ARTEFACT_VERSION=$(echo $VERSION)" >> cask.env
- uses: actions/upload-artifact@v3
with:
name: cask.env
path: cask.env
- name: "Create Release"
uses: softprops/action-gh-release@cd8b57e57218a24af14e307ad8491ec133804ef1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: MiddleMe.zip
bump_homebrew:
name: Bump homebrew cask
runs-on: ubuntu-latest
needs: release
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
with:
name: cask.env
- name: Set git identity
run: |
git config --global user.email "[email protected]"
git config --global user.name "runner"
- name: Load cask env
run: |
cat cask.env >> $GITHUB_ENV
- uses: actions/checkout@v2
with:
ref: main
path: tap
repository: "reeywhaar/homebrew-tap"
token: ${{ secrets.TAP_REPO_TOKEN }}
- name: Update formula
run: ruby update_cask.rb tap/Casks/middleme.rb $ARTEFACT_VERSION $ARTEFACT_SHA256
- name: Commit
run: git add . && git commit -m "MiddleMe $ARTEFACT_VERSION"
working-directory: tap
- name: Push
run: git push origin main
working-directory: tap
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.TAP_REPO_TOKEN }}