Skip to content

Commit

Permalink
- Use ./love-actions-macos-portable instead
Browse files Browse the repository at this point in the history
  • Loading branch information
ParticleG committed Jul 15, 2022
1 parent 5bd7b16 commit 58493e5
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,38 +157,38 @@ runs:
- name: Create directories
shell: bash
run: |
mkdir -p ${{ runner.temp }}/macOS/
mkdir -p ./love-actions-macos-portable/
mkdir -p ${{ inputs.output-folder }}
- name: Checkout love
uses: actions/checkout@v3
with:
path: ${{ runner.temp }}/macOS/love
path: ./love-actions-macos-portable/love
ref: c35356c841976eb6f370347b81eec845d5520338
repository: love2d/love
- name: Checkout framework SDK
uses: actions/checkout@v3
with:
path: ${{ runner.temp }}/macOS/love-apple-dependencies
path: ./love-actions-macos-portable/love-apple-dependencies
ref: 402eed62c2bd654a860bb64544393285fb640497
repository: love2d/love-apple-dependencies
- name: Move framework SDK and love package
shell: bash
run: |
mv ${{ runner.temp }}/macOS/love-apple-dependencies/macOS/Frameworks/ ${{ runner.temp }}/macOS/love/platform/xcode/macosx
mv ${{ runner.temp }}/macOS/love-apple-dependencies/iOS/libraries/ ${{ runner.temp }}/macOS/love/platform/xcode/ios
mv ${{ inputs.love-package }} ${{ runner.temp }}/macOS/love/platform/xcode/game.love
mkdir -p ${{ runner.temp }}/macOS/love/platform/xcode/build/Debug
mkdir -p ${{ runner.temp }}/macOS/love/platform/xcode/build/Release
mv ./love-actions-macos-portable/love-apple-dependencies/macOS/Frameworks/ ./love-actions-macos-portable/love/platform/xcode/macosx
mv ./love-actions-macos-portable/love-apple-dependencies/iOS/libraries/ ./love-actions-macos-portable/love/platform/xcode/ios
mv ${{ inputs.love-package }} ./love-actions-macos-portable/love/platform/xcode/game.love
mkdir -p ./love-actions-macos-portable/love/platform/xcode/build/Debug
mkdir -p ./love-actions-macos-portable/love/platform/xcode/build/Release
- name: Process icons
shell: bash
run: |
rm -rf ${{ runner.temp }}/macOS/love/platform/xcode/Images.xcassets/OS\ X\ AppIcon.appiconset/*.png
iconutil -c iconset -o ${{ runner.temp }}/macOS/icon.iconset ${{ inputs.icon-path }}
mv -f ${{ runner.temp }}/macOS/icon.iconset/* ${{ runner.temp }}/macOS/love/platform/xcode/Images.xcassets/OS\ X\ AppIcon.appiconset/
rm -rf ./love-actions-macos-portable/love/platform/xcode/Images.xcassets/OS\ X\ AppIcon.appiconset/*.png
iconutil -c iconset -o ./love-actions-macos-portable/icon.iconset ${{ inputs.icon-path }}
mv -f ./love-actions-macos-portable/icon.iconset/* ./love-actions-macos-portable/love/platform/xcode/Images.xcassets/OS\ X\ AppIcon.appiconset/
- name: Create keychain and import Developer ID Application certificate
env:
CERTIFICATE_PATH: ${{ runner.temp }}/macOS/cert_app.p12
KEYCHAIN_PATH: ${{ runner.temp }}/macOS/build.keychain
CERTIFICATE_PATH: ./love-actions-macos-portable/cert_app.p12
KEYCHAIN_PATH: ./love-actions-macos-portable/build.keychain
KEYCHAIN_PASSWORD: build_keychain_password
shell: bash
run: |
Expand All @@ -202,8 +202,8 @@ runs:
- name: Import Developer ID Installer certificate
if: "${{ inputs.developer-id-installer-base64 != '' && inputs.developer-id-installer-password != '' }}"
env:
CERTIFICATE_PATH: ${{ runner.temp }}/macOS/cert_inst.p12
KEYCHAIN_PATH: ${{ runner.temp }}/macOS/build.keychain
CERTIFICATE_PATH: ./love-actions-macos-portable/cert_inst.p12
KEYCHAIN_PATH: ./love-actions-macos-portable/build.keychain
KEYCHAIN_PASSWORD: build_keychain_password
shell: bash
run: |
Expand All @@ -225,13 +225,13 @@ runs:
const configuration = 'Release'
const liblovePbxprojPath = '${{ runner.temp }}/macOS/love/platform/xcode/liblove.xcodeproj/project.pbxproj';
const liblovePbxprojPath = './love-actions-macos-portable/love/platform/xcode/liblove.xcodeproj/project.pbxproj';
const libloveProject = xcode.project(liblovePbxprojPath).parseSync();
const libloveTarget = 'liblove-macosx'
libloveProject.updateBuildProperty('MACOSX_DEPLOYMENT_TARGET', '10.9', configuration, libloveTarget);
fs.writeFileSync(liblovePbxprojPath, libloveProject.writeSync());
const lovePbxprojPath = '${{ runner.temp }}/macOS/love/platform/xcode/love.xcodeproj/project.pbxproj';
const lovePbxprojPath = './love-actions-macos-portable/love/platform/xcode/love.xcodeproj/project.pbxproj';
const loveProject = xcode.project(lovePbxprojPath).parseSync();
const loveTarget = 'love-macosx'
loveProject.updateBuildProperty('CODE_SIGN_IDENTITY', '"Developer ID Application"', configuration, loveTarget);
Expand All @@ -247,7 +247,7 @@ runs:
);
fs.writeFileSync(lovePbxprojPath, loveProject.writeSync());
const plistPath = '${{ runner.temp }}/macOS/love/platform/xcode/macosx/love-macosx.plist';
const plistPath = './love-actions-macos-portable/love/platform/xcode/macosx/love-macosx.plist';
const parsed = plist['parse'](fs.readFileSync(plistPath, 'utf8'));
parsed['CFBundleExecutable'] = '${{ inputs.product-name }}';
parsed['CFBundleName'] = '${{ inputs.app-name }}';
Expand All @@ -256,13 +256,13 @@ runs:
delete parsed['UTExportedTypeDeclarations'];
fs.writeFileSync(plistPath, plist['build'](parsed));
const exportPlistPath = '${{ runner.temp }}/macOS/love/platform/xcode/macosx/macos-copy-app.plist';
const exportPlistPath = './love-actions-macos-portable/love/platform/xcode/macosx/macos-copy-app.plist';
const exportPlist = plist['parse'](fs.readFileSync(exportPlistPath, 'utf8'));
exportPlist['method'] = 'developer-id';
exportPlist['teamID'] = '${{ inputs.team-id }}';
fs.writeFileSync(exportPlistPath, plist['build'](exportPlist));
const iconPath = '${{ runner.temp }}/macOS/love/platform/xcode/Images.xcassets/OS X AppIcon.appiconset/Contents.json';
const iconPath = './love-actions-macos-portable/love/platform/xcode/Images.xcassets/OS X AppIcon.appiconset/Contents.json';
const iconContents = JSON.parse(fs.readFileSync(iconPath, 'utf8'));
iconContents.images.forEach(image => {
image.filename = 'icon_' + image.size + (image.scale === '2x' ? '@2x' : '') + '.png';
Expand All @@ -275,59 +275,59 @@ runs:
node temp.js
- name: Build MacOS app
env:
ARCHIVE_PATH: ${{ runner.temp }}/macOS/archive.xcarchive
KEYCHAIN_PATH: ${{ runner.temp }}/macOS/build.keychain
ARCHIVE_PATH: ./love-actions-macos-portable/archive.xcarchive
KEYCHAIN_PATH: ./love-actions-macos-portable/build.keychain
KEYCHAIN_PASSWORD: build_keychain_password
shell: bash
run: |
security unlock-keychain -p $KEYCHAIN_PASSWORD $KEYCHAIN_PATH
xcodebuild clean archive -quiet \
-project ${{ runner.temp }}/macOS/love/platform/xcode/love.xcodeproj \
-project ./love-actions-macos-portable/love/platform/xcode/love.xcodeproj \
-scheme love-macosx \
-configuration Release \
-archivePath ${{ env.ARCHIVE_PATH }} \
OTHER_CFLAGS="-Wno-unused-parameter -Wno-sign-compare -Wno-conditional-uninitialized -Wno-strict-prototypes"
xcodebuild -exportArchive \
-archivePath ${{ env.ARCHIVE_PATH }} \
-exportPath ${{ runner.temp }}/macOS/ \
-exportOptionsPlist ${{ runner.temp }}/macOS/love/platform/xcode/macosx/macos-copy-app.plist
-exportPath ./love-actions-macos-portable/ \
-exportOptionsPlist ./love-actions-macos-portable/love/platform/xcode/macosx/macos-copy-app.plist
- name: Make app zip
shell: bash
run: |
ditto -c -k --sequesterRsrc --keepParent ${{ runner.temp }}/macOS/${{ inputs.product-name }}.app ${{ runner.temp }}/macOS/${{ inputs.product-name }}.zip
ditto -c -k --sequesterRsrc --keepParent ./love-actions-macos-portable/${{ inputs.product-name }}.app ./love-actions-macos-portable/${{ inputs.product-name }}.zip
- name: Notarize application bundle
uses: cocoalibs/xcode-notarization-action@v1
with:
app-path: "${{ runner.temp }}/macOS/${{ inputs.product-name }}.zip"
app-path: "./love-actions-macos-portable/${{ inputs.product-name }}.zip"
apple-id: "${{ inputs.account-username }}"
password: "${{ inputs.account-password }}"
team-id: "${{ inputs.team-id }}"
- name: Create pkg file
if: "${{ inputs.developer-id-installer-base64 != '' && inputs.developer-id-installer-password != '' }}"
env:
KEYCHAIN_PATH: ${{ runner.temp }}/macOS/build.keychain
KEYCHAIN_PATH: ./love-actions-macos-portable/build.keychain
KEYCHAIN_PASSWORD: build_keychain_password
shell: bash
run: |
security unlock-keychain -p $KEYCHAIN_PASSWORD $KEYCHAIN_PATH
identity=$(security find-identity -v | grep -o 'Developer ID Installer[^"]*')
productbuild --component ${{ runner.temp }}/macOS/${{ inputs.product-name }}.app /Applications ${{ runner.temp }}/macOS/${{ inputs.product-name }}_unsigned.pkg
productsign --sign "$identity" ${{ runner.temp }}/macOS/${{ inputs.product-name }}_unsigned.pkg ${{ runner.temp }}/macOS/${{ inputs.product-name }}.pkg
productbuild --component ./love-actions-macos-portable/${{ inputs.product-name }}.app /Applications ./love-actions-macos-portable/${{ inputs.product-name }}_unsigned.pkg
productsign --sign "$identity" ./love-actions-macos-portable/${{ inputs.product-name }}_unsigned.pkg ./love-actions-macos-portable/${{ inputs.product-name }}.pkg
- name: Notarize installer pkg
if: "${{ inputs.developer-id-installer-base64 != '' && inputs.developer-id-installer-password != '' }}"
uses: cocoalibs/xcode-notarization-action@v1
with:
app-path: "${{ runner.temp }}/macOS/${{ inputs.product-name }}.pkg"
app-path: "./love-actions-macos-portable/${{ inputs.product-name }}.pkg"
apple-id: "${{ inputs.account-username }}"
password: "${{ inputs.account-password }}"
team-id: "${{ inputs.team-id }}"
- name: Move installer pkg
if: "${{ inputs.developer-id-installer-base64 != '' && inputs.developer-id-installer-password != '' }}"
shell: bash
run: |
mv ${{ runner.temp }}/macOS/${{ inputs.product-name }}.pkg ${{ inputs.output-folder }}/${{ inputs.product-name }}.pkg
mv ./love-actions-macos-portable/${{ inputs.product-name }}.pkg ${{ inputs.output-folder }}/${{ inputs.product-name }}.pkg
- name: Create dmg file
if: "${{ inputs.dmg-background-path != '' && inputs.dmg-icon-position != '' && inputs.dmg-icon-size != '' && inputs.dmg-link-position != '' && inputs.dmg-text-size != '' && inputs.dmg-volume-icon-path != '' && inputs.dmg-volume-name != '' && inputs.dmg-window-position != '' && inputs.dmg-window-size != '' }}"
shell: bash
Expand All @@ -345,14 +345,14 @@ runs:
--window-pos ${{ inputs.dmg-window-position }} \
--window-size ${{ inputs.dmg-window-size }} \
"${{ inputs.output-folder }}/${{ inputs.product-name }}.dmg" \
"${{ runner.temp }}/macOS/${{ inputs.product-name }}.app"
"./love-actions-macos-portable/${{ inputs.product-name }}.app"
- name: Gather packages in output folder
id: gather-packages
shell: bash
run: |
ditto -c -k --sequesterRsrc --keepParent ${{ runner.temp }}/macOS/${{ inputs.product-name }}.app ${{ inputs.output-folder }}/${{ inputs.product-name }}.zip
ditto -c -k --sequesterRsrc --keepParent ./love-actions-macos-portable/${{ inputs.product-name }}.app ${{ inputs.output-folder }}/${{ inputs.product-name }}.zip
echo ::set-output name=package-paths::$(ls -d ${{ inputs.output-folder }}/*)
- name: Cleanup
shell: bash
run: |
rm -rf ${{ runner.temp }}/macOS/
rm -rf ./love-actions-macos-portable/

0 comments on commit 58493e5

Please sign in to comment.