Trigger build on a release being created #18
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 ] | |
release: | |
types: [ created ] | |
jobs: | |
linux-build: | |
name: Linux build | |
runs-on: ubuntu-latest | |
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: linux-artifacts | |
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 }} | |
SIGN_APP: ${{ secrets.SIGN_APP }} | |
name: Mac build | |
runs-on: macos-latest | |
needs: linux-build | |
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 | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: mac-artifacts | |
path: build/compose/binaries/main/dmg/ | |
release: | |
if: contains(github.ref, 'tags/v') | |
runs-on: ubuntu-latest | |
needs: mac-build | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
merge-multiple: true | |
- name: Display structure of downloaded files | |
run: ls -R artifacts | |
- name: Publish Release | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: artifacts/* | |
draft: false | |
prerelease: false |