Initial commit #1
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" ] | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
build_android: | |
name: Build android | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Retrieve the keystore and decode it to a file | |
env: | |
ANDROID_RELEASE_KEYSTORE_FILE: ${{ secrets.ANDROID_RELEASE_KEYSTORE_FILE }} | |
run: | | |
mkdir keys | |
echo $ANDROID_RELEASE_KEYSTORE_FILE | base64 --decode > keys/release.keystore | |
- name: Write local.properties | |
env: | |
ANDROID_RELEASE_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD }} | |
ANDROID_RELEASE_KEY_ALIAS: ${{ secrets.ANDROID_RELEASE_KEY_ALIAS }} | |
ANDROID_RELEASE_KEY_PASSWORD: ${{ secrets.ANDROID_RELEASE_KEY_PASSWORD }} | |
NYT_API_KEY: ${{ secrets.NYT_API_KEY }} | |
run: | | |
echo androidReleaseStoreFile=../../keys/release.keystore >> local.properties | |
echo androidReleaseStorePassword=$ANDROID_RELEASE_KEYSTORE_PASSWORD >> local.properties | |
echo androidReleaseKeyAlias=$ANDROID_RELEASE_KEY_ALIAS >> local.properties | |
echo androidReleaseKeyPassword=$ANDROID_RELEASE_KEY_PASSWORD >> local.properties | |
echo apiKey=$NYT_API_KEY >> local.properties | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew :app:android:assemble | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: android | |
path: | | |
app/android/build/outputs/apk/debug/android-debug.apk | |
app/android/build/outputs/apk/release/android-release.apk | |
app/android/build/outputs/mapping/release/mapping.txt | |
build_desktop: | |
strategy: | |
matrix: | |
config: [ | |
{ target: apple, os: macos-latest, task: packageDmg }, | |
{ target: windows, os: windows-latest, task: packageMsi }, | |
{ target: linux, os: ubuntu-latest, task: packageDeb }, | |
] | |
runs-on: ${{ matrix.config.os }} | |
name: Build ${{ matrix.config.target }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Write local.properties | |
env: | |
NYT_API_KEY: ${{ secrets.NYT_API_KEY }} | |
run: | | |
echo apiKey=$NYT_API_KEY >> local.properties | |
shell: bash | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew :app:desktop:${{ matrix.config.task }} | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: desktop-${{ matrix.config.target }} | |
path: | | |
app/desktop/build/compose/binaries/main/ | |
build_ios: | |
name: Build iOS | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Setup Cocoapods | |
uses: maxim-lobanov/setup-cocoapods@v1 | |
with: | |
podfile-path: app/ios/Podfile.lock | |
- name: Build with xcode | |
continue-on-error: true # TODO: Fix the certificates | |
run: | | |
cd app/ios | |
pod install | |
xcodebuild -workspace ios.xcworkspace -scheme ios | |
build_web: | |
runs-on: ubuntu-latest | |
name: Build web | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Write local.properties | |
env: | |
NYT_API_KEY: ${{ secrets.NYT_API_KEY }} | |
run: | | |
echo apiKey=$NYT_API_KEY >> local.properties | |
shell: bash | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew :app:web:jsBrowserDistribution | |
- name: Upload pages artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: ${{ github.workspace }}/app/web/build/distributions | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 | |
build_wear: | |
name: Build wear os | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Retrieve the keystore and decode it to a file | |
env: | |
ANDROID_RELEASE_KEYSTORE_FILE: ${{ secrets.ANDROID_RELEASE_KEYSTORE_FILE }} | |
run: | | |
mkdir keys | |
echo $ANDROID_RELEASE_KEYSTORE_FILE | base64 --decode > keys/release.keystore | |
- name: Write local.properties | |
env: | |
ANDROID_RELEASE_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD }} | |
ANDROID_RELEASE_KEY_ALIAS: ${{ secrets.ANDROID_RELEASE_KEY_ALIAS }} | |
ANDROID_RELEASE_KEY_PASSWORD: ${{ secrets.ANDROID_RELEASE_KEY_PASSWORD }} | |
NYT_API_KEY: ${{ secrets.NYT_API_KEY }} | |
run: | | |
echo androidReleaseStoreFile=../../keys/release.keystore >> local.properties | |
echo androidReleaseStorePassword=$ANDROID_RELEASE_KEYSTORE_PASSWORD >> local.properties | |
echo androidReleaseKeyAlias=$ANDROID_RELEASE_KEY_ALIAS >> local.properties | |
echo androidReleaseKeyPassword=$ANDROID_RELEASE_KEY_PASSWORD >> local.properties | |
echo apiKey=$NYT_API_KEY >> local.properties | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew :app:wear:assemble |