diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..47b124c --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,14 @@ +changelog: + exclude: + labels: + - changelog-ignore + categories: + - title: ":rocket: Enhancements" + labels: + - enhancement + - title: ":lady_beetle: Bug fixes" + labels: + - bug + - title: ":shrug: Other changes" + labels: + - "*" \ No newline at end of file diff --git a/.github/workflows/android.yml b/.github/workflows/code-checks.yml similarity index 80% rename from .github/workflows/android.yml rename to .github/workflows/code-checks.yml index 8d1dbfb..d0547cc 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/code-checks.yml @@ -1,4 +1,4 @@ -name: Android CI +name: Code tests & eval on: push: @@ -8,12 +8,12 @@ on: jobs: build: - + name: Build and test runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: set up JDK 11 + - name: Set up JDK 11 uses: actions/setup-java@v2 with: java-version: '11' @@ -22,7 +22,7 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew - - name: Run tests - run: ./gradlew testRelease - name: Build with Gradle run: ./gradlew assembleDebug + - name: Run tests + run: ./gradlew testDebugUnitTest diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml new file mode 100644 index 0000000..e79a28a --- /dev/null +++ b/.github/workflows/release-tag.yml @@ -0,0 +1,83 @@ +name: Tagged releases + +on: + push: + tags: + - 'v*' + +jobs: + release-github: + name: Create GitHub release + runs-on: ubuntu-latest + environment: foss-production + steps: + - name: Decode Keystore + env: + ENCODED_KEYSTORE: ${{ secrets.SIGNING_KEYSTORE_BASE64 }} + run: | + TMP_KEYSTORE_FILE_PATH="${RUNNER_TEMP}"/keystore + mkdir -p "${TMP_KEYSTORE_FILE_PATH}" + KEYSTORE_PATH="${TMP_KEYSTORE_FILE_PATH}"/keystore.jks + echo $ENCODED_KEYSTORE | base64 -di > "${KEYSTORE_PATH}" + echo "STORE_PATH=$(echo $KEYSTORE_PATH)" >> $GITHUB_ENV + + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Get the version + id: tagger + uses: jimschubert/query-tag-action@v2 + with: + skip-unshallow: 'true' + abbrev: false + commit-ish: HEAD + + - name: Install JDK ${{ matrix.java_version }} + uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: 11 + + - name: Assemble beta APK + if: contains(steps.tagger.outputs.tag, '-beta') + run: ./gradlew assembleBeta + env: + VERSION: ${{ github.ref }} + STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }} + KEY_ALIAS: release + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + + - name: Assemble release APK + if: "!contains(steps.tagger.outputs.tag, '-beta')" + run: ./gradlew assembleRelease + env: + VERSION: ${{ github.ref }} + STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }} + KEY_ALIAS: release + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + + - name: Create pre-release + if: contains(steps.tagger.outputs.tag, '-beta') + uses: softprops/action-gh-release@v1 + with: + prerelease: true + tag_name: ${{ steps.tagger.outputs.tag }} + name: ${{ steps.tagger.outputs.tag }} + generate_release_notes: true + files: app/build/outputs/apk/beta/*.apk + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create release + if: "!contains(steps.tagger.outputs.tag, '-beta')" + uses: softprops/action-gh-release@v1 + with: + prerelease: false + tag_name: ${{ steps.tagger.outputs.tag }} + name: ${{ steps.tagger.outputs.tag }} + generate_release_notes: true + files: app/build/outputs/apk/release/*.apk + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/build.gradle b/build.gradle index 068ebb1..1214eff 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { 'version' : [ 'major': 0, 'minor': 0, - 'patch': 1, + 'patch': 2, 'build': 0, ], ]