diff --git a/.github/workflows/build_debug_apk.yml b/.github/workflows/build_debug_apk.yml new file mode 100644 index 0000000..25833b5 --- /dev/null +++ b/.github/workflows/build_debug_apk.yml @@ -0,0 +1,38 @@ +name: "build debug apk" + +on: + push: + branches: [ "develop" ] + tags: [ "d_*" ] + +jobs: + buildDebug: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: prepare_vars + id: prepare + run: | + echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + echo "::set-output name=tag_short::${GITHUB_REF##*/}" + + - name: setup_java + uses: actions/setup-java@v2 + with: + distribution: zulu + java-version: 11 + + - name: assemble + run: ./gradlew assembleDebug + + - name: upload + uses: wei/curl@v1.1.1 + env: + APP_NAME: f1dashboard + APP_VERSION: ${{ steps.prepare.outputs.tag_short }}-${{ steps.prepare.outputs.sha_short }} + URL: https://nexus.n1ks.it + USERNAME: ${{ secrets.NEXUS_USERNAME }} + PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + with: + args: -u $USERNAME:$PASSWORD "$URL//service/rest/v1/components?repository=debugpub" -F "raw.directory=$APP_NAME" -F "raw.asset1=@app/build/outputs/apk/debug/app-debug.apk" -F "raw.asset1.filename=$APP_NAME-$APP_VERSION.apk" diff --git a/.github/workflows/build_release_apk.yml b/.github/workflows/build_release_apk.yml new file mode 100644 index 0000000..789d6e0 --- /dev/null +++ b/.github/workflows/build_release_apk.yml @@ -0,0 +1,68 @@ +name: "build release apk" + +on: + push: + tags: [ "v*" ] + +jobs: + buildRelease: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: prepare_vars + id: prepare + run: | + echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + echo "::set-output name=tag_short::${GITHUB_REF##*/}" + + - name: setup_java + uses: actions/setup-java@v2 + with: + distribution: zulu + java-version: 11 + + - name: assemble + run: ./gradlew assembleRelease + + - name: sign + id: sign + uses: r0adkll/sign-android-release@v1 + env: + BUILD_TOOLS_VERSION: 30.0.3 + with: + releaseDirectory: app/build/outputs/apk/release + signingKeyBase64: ${{ secrets.SIGNING_KEY }} + alias: ${{ secrets.SIGNING_KEY_ALIAS }} + keyStorePassword: ${{ secrets.SIGING_PASSWORD }} + keyPassword: ${{ secrets.SIGING_PASSWORD }} + + - name: apk_rename + id: rename + env: + APP_NAME: f1dashboard + APP_VERSION: ${{ steps.prepare.outputs.tag_short }} + run: | + mv ${{steps.sign.outputs.signedReleaseFile}} $APP_NAME-$APP_VERSION.apk + echo "::set-output name=file_name::$APP_NAME-$APP_VERSION.apk" + + - name: upload_nexus + uses: wei/curl@v1.1.1 + env: + APP_NAME: f1dashboard + APP_VERSION: ${{ steps.prepare.outputs.tag_short }} + URL: https://nexus.n1ks.it + USERNAME: ${{ secrets.NEXUS_USERNAME }} + PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + with: + args: -u $USERNAME:$PASSWORD "$URL//service/rest/v1/components?repository=public" -F "raw.directory=$APP_NAME" -F "raw.asset1=@${{steps.rename.outputs.file_name}}" -F "raw.asset1.filename=$APP_NAME-$APP_VERSION.apk" + + + - name: release + uses: marvinpinto/action-automatic-releases@latest + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "latest" + prerelease: false + title: ${{ steps.prepare.outputs.tag_short }} + files: ${{steps.rename.outputs.file_name}} diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml new file mode 100644 index 0000000..78fd53d --- /dev/null +++ b/.github/workflows/build_test.yml @@ -0,0 +1,23 @@ +name: "test build" + +on: + push: + branches: [ "master", "develop", "feature/*", "bugfix/*" ] + pull_request: + branches: [ "master", "develop" ] + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: setup_java + uses: actions/setup-java@v2 + with: + distribution: zulu + java-version: 11 + + - name: run_tests + run: ./gradlew test diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml index a5f05cd..e34606c 100644 --- a/.idea/jarRepositories.xml +++ b/.idea/jarRepositories.xml @@ -21,5 +21,10 @@