docs: Fix consistency issues with other repositories (#1707)

This commit is contained in:
oSumAtrIX
2024-03-04 12:42:46 +01:00
committed by GitHub
parent e76418d48d
commit 6dee3aa1b7
21 changed files with 433 additions and 287 deletions

View File

@ -1,23 +1,15 @@
name: PR Build
name: Build pull request
on:
workflow_dispatch:
inputs:
# Flutter
flutter-branch:
description: Flutter branch
type: choice
default: 'stable'
options:
- stable
- beta
- dev
- master
# Enable or disable cache
flutter-cache:
description: Cache
type: boolean
default: true
# Application configuration
# Select app flavour
app-flavour:
description: App flavour
default: 'release'
@ -26,22 +18,23 @@ on:
- release
- debug
- profile
# Pull Request
# Select pull request
pr-number:
description: PR number (No hashtag)
description: PR number (Without hashtag)
required: true
run-name: "Build PR ${{ inputs.pr-number }}"
run-name: "Build pull request ${{ inputs.pr-number }}"
jobs:
build:
name: Build the application
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Setup
- name: Setup pull request
env:
GH_TOKEN: ${{ github.token }}
run: |
@ -50,73 +43,74 @@ jobs:
gh repo set-default "${{ github.repository }}"
gh pr checkout "${{ inputs.pr-number }}"
echo "DATETIME=$( TZ='UTC+0' date --rfc-email )" >> $GITHUB_ENV
echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'zulu'
cache: gradle
- name: Setup Flutter
fetch-depth: 0
- name: Cache Gradle
uses: burrunan/gradle-cache-action@v1
- name: Setup Java
run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: ${{ inputs.flutter-branch }}
channel: "stable"
cache: ${{ inputs.flutter-cache }}
- name: Install Flutter dependencies
- name: Get dependencies
run: flutter pub get
- name: Generate translation with Slang
- name: Generate translations
run: dart run slang
- name: Generate files with Builder
run: dart run build_runner build --delete-conflicting-outputs
- name: Build with Flutter
- 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 to comment
- name: Prepare comment
run: |
if [[ "${{ steps.flutter-build.outcome }}" == "success" ]]; then
echo "MESSAGE=✅ ReVanced Manager ${{ env.COMMIT_HASH }} build succeeded." >> $GITHUB_ENV
echo "MESSAGE=✅ Failed build on ${{ env.COMMIT_HASH }}." >> $GITHUB_ENV
else
echo "MESSAGE=🚫 ReVanced Manager ${{ env.COMMIT_HASH }} build failed." >> $GITHUB_ENV
echo "MESSAGE=🚫 Failed build on ${{ env.COMMIT_HASH }}." >> $GITHUB_ENV
fi
- name: "Comment to Pull Request #${{ inputs.pr-number }}"
- 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: |
## ⚒️ ReVanced PR Build workflow
## ⚒️ Build status
${{ env.MESSAGE }}
You can see more details in run [${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})!
Details: [${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})!
### ⚙️ Overview
### ⚙️ Workflow run configuration
- Flutter cache: ${{ inputs.flutter-cache }}
- App flavor: ${{ inputs.app-flavour }}
- Branch: ${{ inputs.flutter-branch }}
- Start time: ${{ env.DATETIME }}
- name: Upload build
- name: Upload
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: revanced-manager-(${{ env.COMMIT_HASH }}-${{ inputs.pr-number }}-${{ inputs.app-flavour }})-${{ inputs.flutter-branch }}
path: |
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

View File

@ -1,4 +1,4 @@
name: "Release Build"
name: Release
on:
workflow_dispatch:
@ -7,7 +7,7 @@ on:
- main
- dev
paths:
- ".github/workflows/release-build.yml"
- ".github/workflows/release.yml"
- "android/**"
- "assets/**"
- "lib/**"
@ -15,43 +15,41 @@ on:
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
- name: Checkout
uses: actions/checkout@v4
with:
java-version: "17"
distribution: "zulu"
fetch-depth: 0
- name: Set up Node.js 20
- 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: '20'
node-version: "lts/*"
cache: 'npm'
- uses: subosito/flutter-action@v2
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Cache Node modules
uses: actions/cache@v4
with:
path: |
node_modules
key: npm-${{ hashFiles('package-lock.json') }}
- name: Setup semantic-release
- name: Install dependencies
run: npm install
- name: Set up Flutter
- name: Get dependencies
run: flutter pub get
- name: Generate translation with Slang
- name: Generate translations
run: dart run slang
- name: Generate files with Builder
- name: Generate code files
run: dart run build_runner build --delete-conflicting-outputs
- name: Build with Flutter
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}
signingKey: "keystore.jks"

View File

@ -1,12 +1,14 @@
name: Crowdin Action
name: Sync Crowdin
on:
workflow_dispatch:
push:
branches: [dev]
branches:
- dev
jobs:
synchronize-with-crowdin:
sync:
name: Sync
runs-on: ubuntu-latest
steps:
- name: Checkout
@ -17,7 +19,7 @@ jobs:
- name: Set up Dart
uses: dart-lang/setup-dart@v1
- name: Sync translation from Crowdin
- name: Sync translations from Crowdin
uses: crowdin/github-action@v1
with:
config: crowdin.yml
@ -26,10 +28,10 @@ jobs:
download_translations: true
localization_branch_name: feat/translations
create_pull_request: true
pull_request_title: "chore(i18n): Sync translations"
pull_request_body: "Sync translations from [Crowdin/ReVanced](https://crowdin.com/project/revanced)"
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(i18n): Sync translations"
commit_message: "chore: Sync translations"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
@ -41,13 +43,13 @@ jobs:
sudo chmod 777 *
dart nuke.dart >> $GITHUB_STEP_SUMMARY
- name: Push out changes to i10n
- name: Commit translations
run: |
git config user.name revanced-bot
git config user.email github@revanced.app
sudo chown -R $USER:$USER .git
git add assets/i18n/*.json
git commit -m "chore(Translation): Remove empty values from JSON" assets/i18n/*.json
git commit -m "chore: Remove empty values from JSON" assets/i18n/*.json
git push origin HEAD:feat/translations
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}