Prevent OOM and null string to integer calls #3869
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: TagMo CI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ master ] | |
| paths-ignore: | |
| - '**/README.md' | |
| - '**/FUNDING.yml' | |
| - '.github/ISSUE_TEMPLATE/**' | |
| - 'assets/**' | |
| permissions: | |
| actions: write | |
| contents: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| orphan: | |
| if: ${{ github.repository == 'HiddenRamblings/TagMo' }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| env: | |
| CI: true | |
| steps: | |
| - name: Drop orphan tags | |
| continue-on-error: true | |
| uses: fabriziocacicia/delete-tags-without-release-action@v0.1.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| wearos: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Validate Gradle wrapper | |
| uses: gradle/actions/wrapper-validation@v4 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Retrieve commit identification | |
| run: | | |
| GIT_BRANCH="${GITHUB_REF_NAME}" | |
| echo "GIT_BRANCH=${GIT_BRANCH}" >> $GITHUB_ENV | |
| GIT_HASH=$(git rev-parse --short HEAD) | |
| echo "GIT_HASH=${GIT_HASH}" >> $GITHUB_ENV | |
| APK_LINK="https://github.com/HiddenRamblings/TagMo/releases/download/master/TagMo-${GIT_HASH}-github-release-signed.apk" | |
| echo "APK_LINK=${APK_LINK}" >> $GITHUB_ENV | |
| - name: Build WearOS APK | |
| run: ./gradlew assembleGithubWearos --no-daemon | |
| - uses: r0adkll/sign-android-release@v1 | |
| if: github.repository == 'HiddenRamblings/TagMo' | |
| name: Sign WearOS APK | |
| # ID used to access action output | |
| id: sign_wear | |
| with: | |
| releaseDirectory: app/build/outputs/apk/github/wearos | |
| signingKeyBase64: ${{ secrets.KEYSTORE_FILE }} | |
| alias: "tagmo" | |
| keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }} | |
| keyPassword: ${{ secrets.KEYSTORE_PASSWORD }} | |
| env: | |
| # override default build-tools version (29.0.3) -- optional | |
| BUILD_TOOLS_VERSION: "34.0.0" | |
| - uses: actions/upload-artifact@v4 | |
| if: github.repository == 'HiddenRamblings/TagMo' | |
| with: | |
| name: TagMo-${{ env.GIT_HASH }}-WearOS | |
| path: | | |
| ${{steps.sign_wear.outputs.signedReleaseFile}} | |
| - uses: 8bitDream/action-github-releases@v1.0.0 | |
| if: github.repository == 'HiddenRamblings/TagMo' && github.event_name != 'pull_request' | |
| with: | |
| repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
| automatic_release_tag: wearos | |
| prerelease: true | |
| title: TagMo-${{ env.GIT_HASH }}-WearOS | |
| files: | | |
| ${{steps.sign_wear.outputs.signedReleaseFile}} | |
| - name: Upload release to discord | |
| if: github.repository == 'HiddenRamblings/TagMo' | |
| uses: sinshutu/upload-to-discord@master | |
| env: | |
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
| with: | |
| args: ${{steps.sign_wear.outputs.signedReleaseFile}} | |
| android: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Validate Gradle wrapper | |
| uses: gradle/actions/wrapper-validation@v4 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Retrieve commit identification | |
| run: | | |
| GIT_BRANCH="${GITHUB_REF_NAME}" | |
| echo "GIT_BRANCH=${GIT_BRANCH}" >> $GITHUB_ENV | |
| GIT_HASH=$(git rev-parse --short HEAD) | |
| echo "GIT_HASH=${GIT_HASH}" >> $GITHUB_ENV | |
| - name: Build Release APK | |
| run: ./gradlew assembleGithubRelease --no-daemon | |
| - uses: r0adkll/sign-android-release@v1 | |
| if: github.repository == 'HiddenRamblings/TagMo' | |
| name: Sign Release APK | |
| # ID used to access action output | |
| id: sign_main | |
| with: | |
| releaseDirectory: app/build/outputs/apk/github/release | |
| signingKeyBase64: ${{ secrets.KEYSTORE_FILE }} | |
| alias: "tagmo" | |
| keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }} | |
| keyPassword: ${{ secrets.KEYSTORE_PASSWORD }} | |
| env: | |
| # override default build-tools version (29.0.3) -- optional | |
| BUILD_TOOLS_VERSION: "34.0.0" | |
| - uses: actions/upload-artifact@v4 | |
| if: github.repository == 'HiddenRamblings/TagMo' | |
| with: | |
| name: TagMo-${{ env.GIT_HASH }} | |
| retention-days: 1 | |
| path: | | |
| ${{steps.sign_main.outputs.signedReleaseFile}} | |
| - uses: 8bitDream/action-github-releases@v1.0.0 | |
| if: github.repository == 'HiddenRamblings/TagMo' && github.event_name != 'pull_request' | |
| with: | |
| repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
| automatic_release_tag: ${{ env.GIT_BRANCH }} | |
| prerelease: ${{ env.GIT_BRANCH != 'master' }} | |
| title: TagMo-${{ env.GIT_HASH }} | |
| files: | | |
| ${{steps.sign_main.outputs.signedReleaseFile}} | |
| - name: Upload release to discord | |
| if: github.repository == 'HiddenRamblings/TagMo' | |
| uses: sinshutu/upload-to-discord@master | |
| env: | |
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
| with: | |
| args: ${{steps.sign_main.outputs.signedReleaseFile}} | |
| - name: Purge cache | |
| if: ${{ github.repository == 'HiddenRamblings/TagMo' && ! startsWith(github.event.head_commit.message, 'Update ') }} | |
| continue-on-error: true | |
| uses: MyAlbum/purge-cache@v1 | |
| with: | |
| max-age: 172800 # 2 days, default: 7 days since last use |