diff --git a/.github/config.yaml b/.github/config.yaml index aaeba6e2..075f56b5 100644 --- a/.github/config.yaml +++ b/.github/config.yaml @@ -1,2 +1,2 @@ firstPRMergeComment: > - ❤️ Thank you for contributing to ReVanced Manager. Join us on [Discord](https://revanced.app/discord) if you want to receive a contributor role. + Thank you for contributing to ReVanced. Join us on [Discord](https://revanced.app/discord) to receive a role for your contribution. diff --git a/.github/workflows/build_pull_request.yml b/.github/workflows/build_pull_request.yml new file mode 100644 index 00000000..250871bc --- /dev/null +++ b/.github/workflows/build_pull_request.yml @@ -0,0 +1,25 @@ +name: Build pull request + +on: + workflow_dispatch: + pull_request: + branches: + - dev + +jobs: + release: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Cache Gradle + uses: burrunan/gradle-cache-action@v1 + + - name: Build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: ./gradlew build --no-daemon diff --git a/.github/workflows/open_pull_request.yml b/.github/workflows/open_pull_request.yml new file mode 100644 index 00000000..75b8e67f --- /dev/null +++ b/.github/workflows/open_pull_request.yml @@ -0,0 +1,26 @@ +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 diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml deleted file mode 100644 index 4ca4a565..00000000 --- a/.github/workflows/pr-build.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build pull request - -on: - pull_request: - paths: - - ".github/workflows/pr-build.yml" - - "app/**" - - "gradle/**" - - "*.properties" - - ".kts" - -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - - name: Set up Gradle - uses: gradle/actions/setup-gradle@v4 - - - name: Build with Gradle - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: ./gradlew assembleRelease --no-daemon -PnoProguard -PsignAsDebug - - - name: Set env - run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - - - name: Add hash to APK - run: mv app/build/outputs/apk/release/app-release.apk revanced-manager-${{ env.COMMIT_HASH }}.apk - - - name: Upload build - uses: actions/upload-artifact@v4 - with: - name: revanced-manager - path: revanced-manager-${{ env.COMMIT_HASH }}.apk diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml deleted file mode 100644 index 4b01fe63..00000000 --- a/.github/workflows/release-build.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Release Build - -on: - push: - tags: - - "v*" - -jobs: - build: - name: Build - runs-on: ubuntu-latest - permissions: - id-token: write - attestations: write - steps: - - uses: actions/checkout@v4 - - name: Set env - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - - name: Set up Gradle - uses: gradle/actions/setup-gradle@v4 - - - name: Build with Gradle - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: ./gradlew assembleRelease --no-daemon - - - name: Sign APK - id: sign_apk - uses: ilharp/sign-android-release@v1 - with: - releaseDir: ./app/build/outputs/apk/release/ - signingKey: ${{ secrets.SIGNING_KEYSTORE }} - keyStorePassword: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }} - keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }} - keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} - - - name: Add version to APK - run: mv ${{ steps.sign_apk.outputs.signedFile }} revanced-manager-${{ env.RELEASE_VERSION }}.apk - - - name: Generate artifact attestation - uses: actions/attest-build-provenance@v1 - with: - subject-path: revanced-manager-${{ env.RELEASE_VERSION }}.apk - - - name: Publish release APK - uses: "marvinpinto/action-automatic-releases@latest" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - prerelease: false - files: revanced-manager-${{ env.RELEASE_VERSION }}.apk diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..2dcb184e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,64 @@ +name: Release + +on: + workflow_dispatch: + push: + branches: + - main + - dev + +jobs: + release: + name: Release + permissions: + contents: write + id-token: write + attestations: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + + - name: Cache Gradle + uses: burrunan/gradle-cache-action@v1 + + - name: Build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: ./gradlew assembleRelease + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "lts/*" + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Setup keystore + run: | + echo "${{ secrets.KEYSTORE }}" | base64 --decode > "app/keystore.jks" + + - name: Semantic Release + uses: cycjimmy/semantic-release-action@v4 + id: semantic + 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 }} + + - name: Attest + if: steps.semantic.outputs.new_release_published == 'true' + uses: actions/attest-build-provenance@v2 + with: + subject-path: build/app/outputs/apk/release/revanced-manager-*.apk \ No newline at end of file diff --git a/.github/workflows/update-documentation.yml b/.github/workflows/update_documentation.yml similarity index 92% rename from .github/workflows/update-documentation.yml rename to .github/workflows/update_documentation.yml index 541a7aa5..f259a4b8 100644 --- a/.github/workflows/update-documentation.yml +++ b/.github/workflows/update_documentation.yml @@ -16,4 +16,4 @@ jobs: token: ${{ secrets.DOCUMENTATION_REPO_ACCESS_TOKEN }} repository: revanced/revanced-documentation event-type: update-documentation - client-payload: '{"repo": "${{ github.event.repository.name }}", "ref": "${{ github.ref }}"}' + client-payload: '{"repo": "${{ github.event.repository.name }}", "ref": "${{ github.ref }}"}' \ No newline at end of file