Skip to content

Commit

Permalink
Add CI to publish on mac app store
Browse files Browse the repository at this point in the history
  • Loading branch information
prof18 committed Apr 6, 2024
1 parent 954e7ab commit 2bc82ef
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/desktop-macos-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
with:
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}

# Developer ID Application
- name: Import signing certificate
uses: apple-actions/import-codesign-certs@v2
with:
Expand Down Expand Up @@ -89,4 +90,5 @@ jobs:
file: ${{ steps.path_variables.outputs.RELEASE_PATH }}
tag: ${{ steps.path_variables.outputs.TAG }}
overwrite: true
draft: true
body: "Release ${{ steps.path_variables.outputs.VERSION }}"
99 changes: 99 additions & 0 deletions .github/workflows/desktop-macos-testflight-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Desktop MacOS Testflight Release
on:
push:
tags:
- '*-desktop'

jobs:
deploy:
runs-on: macos-14
timeout-minutes: 40
permissions:
contents: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup environment
uses: ./.github/actions/setup-gradle
with:
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}

- name: Import Mac App Distribution certificate
uses: apple-actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ secrets.MAC_APP_DISTRIBUTION_CERTIFICATE }}
p12-password: ${{ secrets.MAC_APP_DISTRIBUTION_CERTIFICATE_PWD }}

- name: Import Mac Installer Distribution certificate
uses: apple-actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ secrets.MAC_INSTALLER_DISTRIBUTION_CERTIFICATE }}
p12-password: ${{ secrets.MAC_INSTALLER_DISTRIBUTION_CERTIFICATE_PWD }}
- name: Create Embedded Provision Profile
run: |
echo "$EMBEDDED_PROVISION" > desktopApp/embedded.provisionprofile.b64
base64 -d -i desktopApp/embedded.provisionprofile.b64 > desktopApp/embedded.provisionprofile
env:
EMBEDDED_PROVISION: ${{ secrets.EMBEDDED_PROVISION }}

- name: Create Runtime Provision Profile
run: |
echo "$RUNTIME_PROVISION" > desktopApp/runtime.provisionprofile.b64
base64 -d -i desktopApp/runtime.provisionprofile.b64 > desktopApp/runtime.provisionprofile
env:
RUNTIME_PROVISION: ${{ secrets.RUNTIME_PROVISION }}

- name: Run Checks
run: ./gradlew detekt desktopTest jvmTest

- name: Upload reports
if: failure()
uses: actions/upload-artifact@v4
with:
name: build-reports
path: |
**/build/reports/*
- name: Update Licenses file
run: ./gradlew desktopApp:exportLibraryDefinitions -PaboutLibraries.exportPath=src/main/resources/

- name: Create path variables
id: path_variables
run: |
tag=$(git describe --tags --abbrev=0 --match "*-desktop")
version=$(echo "$tag" | sed 's/-desktop$//')
name="FeedFlow-${version}.pkg"
path="desktopApp/build/release/main-release/pkg/${name}"
echo "TAG=$tag" >> $GITHUB_OUTPUT
echo "VERSION=$version" >> $GITHUB_OUTPUT
echo "RELEASE_PATH=$path" >> $GITHUB_OUTPUT
- name: Create Properties file
run: |
echo "is_release=true" >> desktopApp/src/jvmMain/resources/props.properties
echo "sentry_dns=$SENTRY_DNS" >> desktopApp/src/jvmMain/resources/props.properties
echo "version=$VERSION" >> desktopApp/src/jvmMain/resources/props.properties
env:
SENTRY_DNS: ${{ secrets.SENTRY_DNS }}
VERSION: ${{ steps.path_variables.outputs.VERSION }}

- name: Create PKG
run: ./gradlew packageReleasePkg -PmacOsAppStoreRelease=true

- name: Upload reports
if: failure()
uses: actions/upload-artifact@v4
with:
name: reports
path: |
**/build/compose/logs/*
- uses: Apple-Actions/upload-testflight-build@v1
with:
app-path: ${{ steps.path_variables.outputs.RELEASE_PATH }}
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}

0 comments on commit 2bc82ef

Please sign in to comment.