Skip to content

Main

Main #91

Workflow file for this run

name: Main
on:
workflow_dispatch:
push:
tags:
- "v*.*.*"
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build_android_linux_web:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Create Key.properties File
run: |
echo "storePassword=${{ secrets.STORE_PASSWORD }}" > ./key.properties
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> ./key.properties
echo "alias=${{ secrets.KEY_ALIAS }}" >> ./key.properties
echo "path=${{ runner.temp }}/key.jks" >> ./key.properties
- name: Create Local.properties File
run: |
echo "MAPS_API_KEY=${{ secrets.MAP_API_KEY }}" >> ./local.properties
- name: Create Android keystore File
run: |
echo -n "${{ secrets.ANDROID_KEYSTORE }}" | base64 -d > $RUNNER_TEMP/key.jks
- name: Build APK
run: ./gradlew composeApp:assembleRelease
- name: Build Deb
run: ./gradlew composeApp:packageDeb
- name: Build WASM
run: ./gradlew composeApp:wasmJsBrowserDistribution
- name: Build JS
run: ./gradlew composeApp:jsBrowserDistribution
- name: Generate release assets
env:
VERSION: ${{ github.ref_name }}
run: |
JS_ZIP="com.shreyashkore.wonderouscompose_$VERSION-JS.zip"
WASM_ZIP="com.shreyashkore.wonderouscompose_$VERSION-WASM.zip"
(cd ./composeApp/build/dist && zip -r $JS_ZIP js)
(cd ./composeApp/build/dist && zip -r $WASM_ZIP wasmJs)
- name: Release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: softprops/[email protected]
with:
token: ${{ secrets.TOKEN }}
files: |
./composeApp/build/outputs/apk/release/composeApp-release.apk
./composeApp/build/compose/binaries/main/deb/*.deb
./composeApp/build/dist/*.zip
- name: Deploy Wasm
if: ${{ github.event_name == 'release' }}
uses: JamesIves/[email protected]
with:
token: ${{ secrets.TOKEN }}
branch: main
folder: composeApp/build/dist/wasmJs/productionExecutable
repository-name: ShreyashKore/wonderous-compose-wasm
- name: Deploy JS
if: ${{ github.event_name == 'release' }}
uses: JamesIves/[email protected]
with:
token: ${{ secrets.TOKEN }}
branch: main
folder: composeApp/build/dist/js/productionExecutable
repository-name: ShreyashKore/wonderous-compose-js
build_windows:
permissions:
contents: write
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: |
chmod +x gradlew
- name: Create dummy local.properties
run: echo "sdk.dir=some_location" > ./local.properties
- name: Build MSI
run: |
./gradlew composeApp:packageMsi
- name: Upload Release Asset
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: softprops/[email protected]
with:
token: ${{ secrets.TOKEN }}
files: |
./composeApp/build/compose/binaries/main/msi/*.msi
# build_ios:
# runs-on: macos-latest
#
# steps:
# - uses: actions/checkout@v4
# - name: set up JDK 17
# uses: actions/setup-java@v3
# with:
# java-version: '17'
# distribution: 'temurin'
# cache: gradle
#
# - name: Grant execute permission for gradlew
# run: chmod +x gradlew
# - name: "Setup Gradle"
# uses: gradle/gradle-build-action@v2
# - name: "Build xcworkspace"
# run: ./gradlew podInstall