Add commands #76
Workflow file for this run
This file contains hidden or 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 and Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| apk: | |
| name: Generate APK | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2.4.0 | |
| - name: Setup JDK | |
| uses: actions/setup-java@v2.5.0 | |
| with: | |
| distribution: temurin | |
| java-version: "17" | |
| - name: Set execution flag for gradlew | |
| run: chmod +x gradlew | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v2 | |
| - name: Install Android Build Tools | |
| run: sdkmanager "build-tools;29.0.3" | |
| - name: Run common unit tests | |
| run: bash ./gradlew :common:cleanTestDebugUnitTest :common:testDebugUnitTest | |
| - name: Build APK | |
| run: bash ./gradlew assembleRelease --stacktrace | |
| - name: Sign APK | |
| uses: r0adkll/sign-android-release@v1 | |
| with: | |
| releaseDirectory: android/build/outputs/apk/release | |
| signingKeyBase64: ${{ secrets.KEYSTORE_B64 }} | |
| alias: ${{ secrets.KEY_ALIAS }} | |
| keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }} | |
| keyPassword: ${{ secrets.KEYSTORE_PASSWORD }} | |
| - name: Upload APK Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: signed-apk | |
| path: android/build/outputs/apk/release/android-release-unsigned-signed.apk | |
| - name: Build cli JAR | |
| run: bash ./gradlew :cli:createJar | |
| - name: Upload cli JAR Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cli-jar | |
| path: cli/build/libs/linuxcommandlibrary.jar | |
| release: | |
| name: Release APK and JAR | |
| needs: apk | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2.4.0 | |
| - name: Download APK Artifact | |
| uses: actions/download-artifact@v4.1.7 | |
| with: | |
| name: signed-apk | |
| - name: Download JAR Artifact | |
| uses: actions/download-artifact@v4.1.7 | |
| with: | |
| name: cli-jar | |
| - name: Create Github Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Release ${{ github.ref }} | |
| - name: Upload APK to Github Release | |
| id: upload_apk | |
| uses: actions/upload-release-asset@v1.0.1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: android-release-unsigned-signed.apk | |
| asset_name: LinuxCommandLibrary.apk | |
| asset_content_type: application/zip | |
| - name: Upload JAR to Github Release | |
| id: upload_jar | |
| uses: actions/upload-release-asset@v1.0.1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: linuxcommandlibrary.jar | |
| asset_name: linuxcommandlibrary.jar | |
| asset_content_type: application/zip |