diff --git a/.github/workflows/build_pull_request.yml b/.github/workflows/build_pull_request.yml deleted file mode 100644 index a0cc8d082d..0000000000 --- a/.github/workflows/build_pull_request.yml +++ /dev/null @@ -1,117 +0,0 @@ -name: Build pull request - -on: - workflow_dispatch: - inputs: - # Enable or disable cache - flutter-cache: - description: Cache - type: boolean - default: true - - # Select app flavour - app-flavour: - description: App flavour - default: 'release' - type: choice - options: - - release - - debug - - profile - - # Select pull request - pr-number: - description: PR number (Without hashtag) - required: true - -run-name: "Build pull request ${{ inputs.pr-number }}" - -jobs: - build: - name: Build - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - steps: - - name: Setup pull request - env: - GH_TOKEN: ${{ github.token }} - run: | - gh repo clone "${{ github.repository }}" - cd revanced-manager - gh repo set-default "${{ github.repository }}" - gh pr checkout "${{ inputs.pr-number }}" - - echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - - - name: Checkout - uses: actions/checkout@v4 - with: - persist-credentials: false - fetch-depth: 0 - - - name: Cache Gradle - uses: burrunan/gradle-cache-action@v2 - - - name: Setup Java - run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV - - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - channel: "stable" - flutter-version: 3.24.x - cache: ${{ inputs.flutter-cache }} - - - name: Get dependencies - run: flutter pub get - - - name: Generate translations - run: dart run slang - - - name: Generate code files - run: dart run build_runner build --delete-conflicting-outputs - - - name: Build - continue-on-error: true - id: flutter-build - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - flutter build apk --"${{ inputs.app-flavour }}"; - - - name: Prepare comment - run: | - if [[ "${{ steps.flutter-build.outcome }}" == "success" ]]; then - echo "MESSAGE=✅ Succeeded build on ${{ env.COMMIT_HASH }}." >> $GITHUB_ENV - else - echo "MESSAGE=🚫 Failed build on ${{ env.COMMIT_HASH }}." >> $GITHUB_ENV - fi - - - name: "Comment on pull request #${{ inputs.pr-number }}" - uses: thollander/actions-comment-pull-request@v2 - with: - GITHUB_TOKEN: ${{ github.token }} - pr_number: ${{ inputs.pr-number }} - mode: recreate - message: | - ## ⚒️ Build status - - ${{ env.MESSAGE }} - - Details: [${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})! - - ### ⚙️ Workflow run configuration - - - Flutter cache: ${{ inputs.flutter-cache }} - - App flavor: ${{ inputs.app-flavour }} - - - name: Upload - uses: actions/upload-artifact@v4 - with: - if-no-files-found: error - name: revanced-manager-(${{ env.COMMIT_HASH }}-${{ inputs.pr-number }}-${{ inputs.app-flavour }}) - path: | - build/app/outputs/flutter-apk/app-${{ inputs.app-flavour }}.apk - build/app/outputs/flutter-apk/app-${{ inputs.app-flavour }}.apk.sha1 diff --git a/.github/workflows/discord_ping_on_release.yml b/.github/workflows/discord_ping_on_release.yml new file mode 100644 index 0000000000..a9112372d4 --- /dev/null +++ b/.github/workflows/discord_ping_on_release.yml @@ -0,0 +1,22 @@ +name: Ping Discord on release + +on: + release: + types: [published] + +jobs: + notify-discord: + runs-on: ubuntu-latest + steps: + - uses: sarisia/actions-status-discord@v1 + if: always() + with: + webhook: ${{ secrets.DISCORD_WEBHOOK_URL }} + username: ReVanced Extended + color: 0xff5252 + nodetail: true + notimestamp: true + content: "<@&1271198041361354833>" + title: "RVX Manager `${{ github.event.release.tag_name }}` has been released!" + description: | + Click [here](${{ github.event.release.html_url }}) to download it and read the changelog. \ No newline at end of file diff --git a/.github/workflows/open_pull_request.yml b/.github/workflows/open_pull_request.yml deleted file mode 100644 index 840020c30e..0000000000 --- a/.github/workflows/open_pull_request.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Open a PR to main - -on: - push: - branches: - - dev - workflow_dispatch: - -env: - MESSAGE: Merge branch `${{ github.head_ref || github.ref_name }}` to `main` - -jobs: - pull-request: - name: Open pull request - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Open pull request - uses: repo-sync/pull-request@v2 - with: - destination_branch: 'main' - pr_title: 'chore: ${{ env.MESSAGE }}' - pr_body: | - This pull request will ${{ env.MESSAGE }}. - pr_draft: true - github_token: ${{ secrets.REPOSITORY_PUSH_ACCESS }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 4513330e57..0000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Release - -on: - workflow_dispatch: - push: - branches: - - main - - dev - paths: - - ".github/workflows/release.yml" - - "android/**" - - "assets/**" - - "lib/**" - - "pubspec.yaml" - -jobs: - release: - name: Release - permissions: - contents: write - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Java - run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: "lts/*" - cache: 'npm' - - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - channel: stable - - - name: Install dependencies - run: npm ci - - - name: Get dependencies - run: flutter pub get - - - name: Generate translations - run: dart run slang - - - name: Generate code files - run: dart run build_runner build --delete-conflicting-outputs - - - name: Setup keystore - run: | - echo "${{ secrets.KEYSTORE }}" | base64 --decode > "android/app/keystore.jks" - - - name: Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} - KEYSTORE_ENTRY_ALIAS: ${{ secrets.KEYSTORE_ENTRY_ALIAS }} - KEYSTORE_ENTRY_PASSWORD: ${{ secrets.KEYSTORE_ENTRY_PASSWORD }} - run: | - npx semantic-release diff --git a/.github/workflows/sync_crowdin.yml b/.github/workflows/sync_crowdin.yml deleted file mode 100644 index a802dfe019..0000000000 --- a/.github/workflows/sync_crowdin.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Sync Crowdin - -on: - workflow_dispatch: - schedule: - - cron: 00 12 * * 1 - push: - branches: dev - paths: - - assets/i18n/*.json - - assets/i18n/*.dart - - .github/workflows/sync_crowdin.yml - -jobs: - sync: - name: Sync - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Flutter - uses: subosito/flutter-action@v2 - with: - cache: true - flutter-version: 3.24.x - - - name: Sync translations from Crowdin - uses: crowdin/github-action@v1 - with: - config: crowdin.yml - upload_sources: true - upload_translations: false - download_translations: true - localization_branch_name: feat/translations - create_pull_request: true - pull_request_title: "chore: Sync translations" - pull_request_body: "Sync translations from [crowdin.com/project/revanced](https://crowdin.com/project/revanced)" - pull_request_base_branch_name: "dev" - commit_message: "chore: Sync translations" - github_user_name: revanced-bot - github_user_email: github@revanced.app - env: - GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }} - CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} - CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} - - # There has to be a better way to do this - - name: Normalization of Translation Strings - run: | - dart pub get - cd assets/i18n - sudo chmod 766 *.json - cd ../.. - dart run slang analyze - dart run slang clean - dart run slang normalize - cd assets/i18n - dart nuke.dart >> $GITHUB_STEP_SUMMARY - cd ../.. - dart run slang - flutter analyze lib/gen/strings.g.dart --no-fatal-infos --no-fatal-warnings - - - name: Commit translations - run: | - git config user.name revanced-bot - git config user.email github@revanced.app - sudo chown -R $USER:$USER .git - git commit -m "chore: Remove empty values from JSON" assets/i18n/strings_*.json - git push origin HEAD:feat/translations diff --git a/.github/workflows/update_documentation.yml b/.github/workflows/update_documentation.yml deleted file mode 100644 index 541a7aa5b5..0000000000 --- a/.github/workflows/update_documentation.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Update documentation - -on: - push: - paths: - - docs/** - -jobs: - trigger: - runs-on: ubuntu-latest - name: Dispatch event to documentation repository - if: github.ref == 'refs/heads/main' - steps: - - uses: peter-evans/repository-dispatch@v3 - with: - token: ${{ secrets.DOCUMENTATION_REPO_ACCESS_TOKEN }} - repository: revanced/revanced-documentation - event-type: update-documentation - client-payload: '{"repo": "${{ github.event.repository.name }}", "ref": "${{ github.ref }}"}'