Setup github action build pipeline #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
linux-build: | |
name: Linux build | |
runs-on: ubuntu-latest | |
needs: mac-build | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: corretto | |
java-version: 17 | |
- name: Set up Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
gradle-version: "8.1.1" | |
- name: Run lint check | |
run: ./gradlew ktlintCheck | |
- name: Run tests | |
run: ./gradlew test | |
- name: Create Package deb | |
run: ./gradlew packageDeb --info | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: LinuxPackage | |
path: build/libs | |
mac-build: | |
env: | |
APPLE_ID_TEMP: ${{ secrets.APPLE_ID_TEMP }} | |
IDENTITY_TEMP: ${{ secrets.IDENTITY_TEMP }} | |
NOTARIZATION_PASSWORD_TEMP: ${{ secrets.NOTARIZATION_PASSWORD_TEMP }} | |
PROVIDER_TEMP: ${{ secrets.PROVIDER_TEMP }} | |
SIGNING_CERT_TEMP: ${{ secrets.SIGNING_CERT_TEMP }} | |
SIGNING_PASS_TEMP: ${{ secrets.SIGNING_PASS_TEMP }} | |
name: Mac build | |
runs-on: macos-latest | |
steps: | |
- name: Decode signing cert | |
run: base64 -D -o cert.p12 <<< $SIGNING_CERT_TEMP | |
- name: Create new keychain | |
run: security create-keychain -p keychain-pass compose.keychain | |
- name: Import signing cert | |
run: security import ./cert.p12 -t agg -k compose.keychain -P $SIGNING_PASS_TEMP -A | |
- name: Make chain accessible | |
run: | | |
security list-keychains -s "compose.keychain" | |
security list-keychains | |
security default-keychain -s "compose.keychain" | |
security unlock-keychain -p "keychain-pass" "compose.keychain" | |
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k keychain-pass | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: corretto | |
java-version: 17 | |
- name: Set up Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
gradle-version: "8.1.1" | |
- name: Create DMG | |
run: ./gradlew packageDmg --stacktrace | |
- name: Notarize DMG | |
run: ./gradlew notarizeDmg | |
continue-on-error: true | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: MacPackage | |
path: build/compose/logs |