133 lines
4.4 KiB
YAML
133 lines
4.4 KiB
YAML
name: 'build Mac OS'
|
|
description: 'build Mac OS package'
|
|
inputs:
|
|
name:
|
|
required: true
|
|
type:
|
|
required: true
|
|
icon:
|
|
required: true
|
|
DEVELOPER_APP_IDENTIFIER:
|
|
required: true
|
|
MATCH_PASSWORD:
|
|
required: true
|
|
GIT_AUTHORIZATION:
|
|
required: true
|
|
TEMP_KEYCHAIN_PASSWORD:
|
|
required: true
|
|
TEMP_KEYCHAIN_USER:
|
|
required: true
|
|
APPLE_KEY_ID:
|
|
required: true
|
|
APPLE_ISSUER_ID:
|
|
required: true
|
|
APPLE_KEY_CONTENT:
|
|
required: true
|
|
BUNDLE_ID:
|
|
required: true
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- uses: ./.github/actions/build-love
|
|
- name: Checkout template
|
|
uses: actions/checkout@v2
|
|
with:
|
|
repository: '26F-Studio/Techmino-macOS'
|
|
path: 'Techmino-macOS'
|
|
- name: Download ColdClear
|
|
uses: ./.github/actions/get-cc
|
|
with:
|
|
arch: macOS
|
|
- name: Fastlane match
|
|
uses: maierj/fastlane-action@v2.0.1
|
|
with:
|
|
lane: 'get_cert'
|
|
subdirectory: 'Techmino-macOS'
|
|
env:
|
|
DEVELOPER_APP_IDENTIFIER: '${{ inputs.DEVELOPER_APP_IDENTIFIER }}'
|
|
MATCH_PASSWORD: '${{ inputs.MATCH_PASSWORD }}'
|
|
GIT_AUTHORIZATION: '${{ inputs.GIT_AUTHORIZATION }}'
|
|
TEMP_KEYCHAIN_PASSWORD: '${{ inputs.TEMP_KEYCHAIN_PASSWORD }}'
|
|
TEMP_KEYCHAIN_USER: '${{ inputs.TEMP_KEYCHAIN_USER }}'
|
|
APPLE_KEY_ID: '${{ inputs.APPLE_KEY_ID }}'
|
|
APPLE_ISSUER_ID: '${{ inputs.APPLE_ISSUER_ID }}'
|
|
APPLE_KEY_CONTENT: '${{ inputs.APPLE_KEY_CONTENT }}'
|
|
- name: Modify template
|
|
shell: bash
|
|
run: |
|
|
python3 .github/workflows/updateVersion.py -T macOS_${{ inputs.type }} -N ${{ inputs.name }}
|
|
mv Techmino.love Techmino-macOS/Techmino.app/Contents/Resources
|
|
mv CCloader.dylib Techmino-macOS/Techmino.app/Contents/Frameworks
|
|
mv ${{ inputs.icon }} Techmino-macOS/Techmino.app/Contents/Resources/iconfile.icns
|
|
|
|
chmod +x Techmino-macOS/Techmino.app/Contents/Frameworks/CCloader.dylib
|
|
chmod +x Techmino-macOS/Techmino.app/Contents/MacOS/love
|
|
- name: Codesign executable
|
|
shell: bash
|
|
run: |
|
|
security unlock-keychain -p ${{ inputs.TEMP_KEYCHAIN_PASSWORD }} \
|
|
~/Library/Keychains/${{ inputs.TEMP_KEYCHAIN_USER }}-db
|
|
|
|
[[ $(security find-identity) =~ ([0-9A-F]{40}) ]]
|
|
|
|
codesign --timestamp --force --strict --deep -v \
|
|
--options runtime \
|
|
-s ${BASH_REMATCH[1]} \
|
|
--entitlements Techmino-macOS/love.entitlements \
|
|
Techmino-macOS/Techmino.app
|
|
- name: Fastlane notarize
|
|
uses: maierj/fastlane-action@v2.0.1
|
|
with:
|
|
lane: 'make_safe'
|
|
subdirectory: 'Techmino-macOS'
|
|
env:
|
|
APPLE_KEY_ID: '${{ inputs.APPLE_KEY_ID }}'
|
|
APPLE_ISSUER_ID: '${{ inputs.APPLE_ISSUER_ID }}'
|
|
APPLE_KEY_CONTENT: '${{ inputs.APPLE_KEY_CONTENT }}'
|
|
NOTARIZE_OBJECT: 'Techmino.app'
|
|
BUNDLE_ID: '${{ inputs.BUNDLE_ID }}'
|
|
- name: Create DMG file
|
|
shell: bash
|
|
run: |
|
|
brew install create-dmg
|
|
create-dmg \
|
|
--volname "Techmino for MacOS" \
|
|
--volicon "./.github/build/macOS/icon.icns" \
|
|
--window-pos 200 120 \
|
|
--window-size 800 400 \
|
|
--icon-size 100 \
|
|
--icon "Techmino.app" 200 190 \
|
|
--hide-extension "Techmino.app" \
|
|
--app-drop-link 600 185 \
|
|
"Techmino-macOS/Techmino-macOS.dmg" \
|
|
"Techmino-macOS/Techmino.app/"
|
|
- name: Codesign DMG
|
|
shell: bash
|
|
run: |
|
|
security unlock-keychain -p ${{ inputs.TEMP_KEYCHAIN_PASSWORD }} \
|
|
~/Library/Keychains/${{ inputs.TEMP_KEYCHAIN_USER }}-db
|
|
|
|
[[ $(security find-identity) =~ ([0-9A-F]{40}) ]]
|
|
|
|
codesign --timestamp --force --strict --deep -v \
|
|
--options runtime \
|
|
-s ${BASH_REMATCH[1]} \
|
|
--entitlements Techmino-macOS/love.entitlements \
|
|
Techmino-macOS/Techmino-macOS.dmg
|
|
- name: Fastlane notarize
|
|
uses: maierj/fastlane-action@v2.0.1
|
|
with:
|
|
lane: 'make_safe'
|
|
subdirectory: 'Techmino-macOS'
|
|
env:
|
|
APPLE_KEY_ID: '${{ inputs.APPLE_KEY_ID }}'
|
|
APPLE_ISSUER_ID: '${{ inputs.APPLE_ISSUER_ID }}'
|
|
APPLE_KEY_CONTENT: '${{ inputs.APPLE_KEY_CONTENT }}'
|
|
NOTARIZE_OBJECT: 'Techmino-macOS.dmg'
|
|
BUNDLE_ID: '${{ inputs.BUNDLE_ID }}'
|
|
- name: Finalize
|
|
shell: bash
|
|
run: |
|
|
mv Techmino-macOS/Techmino-macOS.dmg Techmino.dmg
|
|
spctl -a -t open --context context:primary-signature -vv Techmino.dmg
|