Skip to content

update version

update version #66

name: Sign and Distribute macOS App
on:
push:
branches:
- main
jobs:
build:
runs-on: macos-14
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.2'
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
EXPORT_CERTIFICATE_BASE64: ${{ secrets.EXPORT_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# create variables
BUILD_CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
EXPORT_CERTIFICATE_PATH=$RUNNER_TEMP/export_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $BUILD_CERTIFICATE_PATH
echo -n "$EXPORT_CERTIFICATE_BASE64" | base64 --decode -o $EXPORT_CERTIFICATE_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $BUILD_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security import $EXPORT_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
xcodebuild -scheme HappyPathTimeTracker -allowProvisioningUpdates -configuration Release build
xcodebuild -scheme HappyPathTimeTracker -configuration Release archive -archivePath ~/Desktop/Happy/HappyPathTimeTracker.xcarchive
xcodebuild -exportArchive -archivePath ~/Desktop/Happy/HappyPathTimeTracker.xcarchive -exportPath ~/Desktop/Happy/HappyPathTimeTracker -exportOptionsPlist ExportOptions.plist
rm -rf ~/Desktop/Happy/HappyPathTimeTracker/*.plist
rm -rf ~/Desktop/Happy/HappyPathTimeTracker/*.log
pkgbuild --root ~/Desktop/Happy/HappyPathTimeTracker/ --identifier com.gorkemsevim.HappyPathTimeTracker --version 1.1.1 --install-location /Applications happy-path-macos-client.pkg
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: test
files: |
happy-path-macos-client.pkg