diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml new file mode 100644 index 000000000..4bd6c97d4 --- /dev/null +++ b/.github/workflows/build-release.yml @@ -0,0 +1,54 @@ +name: Build and release app + +on: + workflow_dispatch: + push: + tags: + - 'v*.*' + +jobs: + build: + name: Build, sign and release app + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: "zulu" + java-version: "17" + cache: "gradle" + + - name: Build APK + run: ./gradlew assembleRelease --no-daemon + + - name: Sign APK + uses: ilharp/sign-android-release@v1 + id: sign + with: + signingKey: ${{ secrets.KEYSTORE }} + keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }} + keyStorePassword: ${{ secrets.SIGNING_STORE_PASSWORD }} + keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} + + - name: Rename signed APK + run: | + mv "${{ steps.sign.outputs.signedFile }}" "app-release.apk" + + - name: Create changelog + id: changelog + uses: requarks/changelog-action@v1 + with: + token: ${{ github.token }} + tag: ${{ github.ref_name }} + + - name: Create release + uses: softprops/action-gh-release@v2 + with: + body: ${{ steps.changelog.outputs.changes }} + files: "app-release.apk" + fail_on_unmatched_files: true + make_latest: true diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml deleted file mode 100644 index 395e2a714..000000000 --- a/.github/workflows/codacy.yml +++ /dev/null @@ -1,61 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# This workflow checks out code, performs a Codacy security scan -# and integrates the results with the -# GitHub Advanced Security code scanning feature. For more information on -# the Codacy security scan action usage and parameters, see -# https://github.com/codacy/codacy-analysis-cli-action. -# For more information on Codacy Analysis CLI in general, see -# https://github.com/codacy/codacy-analysis-cli. - -name: Codacy Security Scan - -on: - push: - branches: [ "master" ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "master" ] - schedule: - - cron: '16 9 * * 2' - -permissions: - contents: read - -jobs: - codacy-security-scan: - permissions: - contents: read # for actions/checkout to fetch code - security-events: write # for github/codeql-action/upload-sarif to upload SARIF results - actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status - name: Codacy Security Scan - runs-on: ubuntu-latest - steps: - # Checkout the repository to the GitHub Actions runner - - name: Checkout code - uses: actions/checkout@v4 - - # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis - - name: Run Codacy Analysis CLI - uses: codacy/codacy-analysis-cli-action@33d455949345bddfdb845fba76b57b70cc83754b - with: - # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository - # You can also omit the token and run the tools that support default configurations - project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} - verbose: true - output: results.sarif - format: sarif - # Adjust severity of non-security issues - gh-code-scanning-compat: true - # Force 0 exit code to allow SARIF file generation - # This will handover control about PR rejection to the GitHub side - max-allowed-issues: 2147483647 - - # Upload the SARIF file generated in the previous step - - name: Upload SARIF results file - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: results.sarif diff --git a/.github/workflows/validate-store-files.yml b/.github/workflows/validate-store-files.yml deleted file mode 100644 index c72f44c9a..000000000 --- a/.github/workflows/validate-store-files.yml +++ /dev/null @@ -1,79 +0,0 @@ -# This action checks that the store files are valid for Play Store. Current checks: -# - title and description files must not exceed a maximum number of characters -# To be replaced with a more powerful (and less manual) one -name: Validate store files - -# Note: this is the second time I'm writing a GitHub action, and the first time I'm using a script. -# Most probably there are better ways to do it, if you know one and want to suggest it that'd be wonderful! -# -# Made by TrianguloY initially for URLCheck (https://github.com/TrianguloY/UrlChecker) - -on: - push: - branches: - - master - pull_request: - branches: - - master - -jobs: - validation: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/github-script@v7 - with: - script: | - // import - const { lstatSync, readdirSync, readFileSync, existsSync } = require('fs'); - const { join } = require('path'); - // header - console.log("Validating files:"); - console.log(""); - let error = false; - // for each locale - const listings = "./fastlane/metadata/android"; - readdirSync(listings) - .map(locale => [locale, join(listings, locale)]) - .filter(([locale, path]) => lstatSync(path).isDirectory()) - .forEach(([locale, path]) => { - console.log(`[ ] - '${locale}'`); - // check files length - ([ - ["title.txt", 30], - ["short_description.txt", 80], - ["full_description.txt", 4000], - ]).forEach(([file, limit]) => { - // get file - const subpath = join(path, file); - if(existsSync(subpath)){ - // file exists, check content length - const size = readFileSync(subpath).toString().trim().length; - if(size > limit) { - // invalid length, error - error = true; - console.log(`[ERROR ] - '${file}' length: ${size}/${limit}`); - console.log(""); - // '[ERROR]' is detected on GitHub and the line is displayed on red - console.log(`[ERROR] File ${file} from locale ${locale} (${subpath}) must be ${limit} or less characters long, current length: ${size}. Use synonims or remove less important sentences, otherwise Play Store won't accept it.`); - console.log(""); - }else{ - // valid length - console.log(`[ OK ] - '${file}' length: ${size}/${limit}`); - } - }else{ - // no file - console.log(`[ SKIP ] - '${file}': not found`); - } - }) - }); - // result - console.log(""); - if (error) { - // error, exit - console.log("Validation finished. Errors found, check above for their details"); - process.exit(1); - }else{ - // ok, end - console.log("Validation finished. No errors found."); - }