Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
buschNT committed Mar 24, 2023
1 parent 0aa47b6 commit de25af9
Showing 1 changed file with 67 additions and 67 deletions.
134 changes: 67 additions & 67 deletions .github/workflows/dist-build-mac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,77 +9,77 @@ on:
workflow_dispatch: {}
push:
tags:
- '*'
- "*"
branches:
- 'windows-port'
- "windows-port"
release:
types: [published]

jobs:
build:
runs-on: macos-10.15
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Setup XCode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Setup PyOxidizer and build
run: |
wget ${PYOXIDIZER_DOWNLOAD}
unzip PyOxidizer-0.20.0-exe-macos-universal.zip
sudo chmod +x ./pyoxidizer
./pyoxidizer build exe --release
cp `find build/ -name "deck"` ./deck
cat pyproject.toml | grep version -m 1 | awk '{ print "APP_VERSION="substr($3, 2, length($3) -2)}' >> $GITHUB_ENV
- name: Codesign executable
env:
MACOS_DEVELOPER_HASH: ${{ secrets.MACOS_DEVELOPER_HASH }}
MACOS_APP_HASH: ${{ secrets.MACOS_APP_HASH }}
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_KEYCHAIN_PASS: ${{ secrets.MACOS_KEYCHAIN_PASS }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p $MACOS_KEYCHAIN_PASS build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p $MACOS_KEYCHAIN_PASS build.keychain
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_KEYCHAIN_PASS build.keychain
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
</dict>
</plist>" > entitlements.plist
echo "Now running codesign"
/usr/bin/codesign --deep --force --options=runtime --entitlements ./entitlements.plist --sign $MACOS_APP_HASH --timestamp ./deck
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: deck-${{ env.APP_VERSION }}-darwin-universal
path: |
deck
LICENSE
README.md
retention-days: 5
- name: Create release zip
if: ${{ github.event.release && github.event.action == 'published' }}
run: zip deck-${{ env.APP_VERSION }}-darwin-universal.zip "deck" "LICENSE" "README.md"
- name: Attach files to release
uses: softprops/action-gh-release@v1
if: ${{ github.event.release && github.event.action == 'published' }}
with:
files: deck-${{ env.APP_VERSION }}-darwin-universal.zip
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Setup XCode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Setup PyOxidizer and build
run: |
wget ${PYOXIDIZER_DOWNLOAD}
unzip PyOxidizer-0.20.0-exe-macos-universal.zip
sudo chmod +x ./pyoxidizer
./pyoxidizer build exe --release
cp `find build/ -name "deck"` ./deck
cat pyproject.toml | grep version -m 1 | awk '{ print "APP_VERSION="substr($3, 2, length($3) -2)}' >> $GITHUB_ENV
- name: Codesign executable
env:
MACOS_DEVELOPER_HASH: ${{ secrets.MACOS_DEVELOPER_HASH }}
MACOS_APP_HASH: ${{ secrets.MACOS_APP_HASH }}
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_KEYCHAIN_PASS: ${{ secrets.MACOS_KEYCHAIN_PASS }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p $MACOS_KEYCHAIN_PASS build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p $MACOS_KEYCHAIN_PASS build.keychain
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_KEYCHAIN_PASS build.keychain
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
</dict>
</plist>" > entitlements.plist
echo "Now running codesign"
/usr/bin/codesign --deep --force --options=runtime --entitlements ./entitlements.plist --sign $MACOS_APP_HASH --timestamp ./deck
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: deck-${{ env.APP_VERSION }}-darwin-universal
path: |
deck
LICENSE
README.md
retention-days: 5
- name: Create release zip
if: ${{ github.event.release && github.event.action == 'published' }}
run: zip deck-${{ env.APP_VERSION }}-darwin-universal.zip "deck" "LICENSE" "README.md"
- name: Attach files to release
uses: softprops/action-gh-release@v1
if: ${{ github.event.release && github.event.action == 'published' }}
with:
files: deck-${{ env.APP_VERSION }}-darwin-universal.zip

0 comments on commit de25af9

Please sign in to comment.