updates to match YT Sleep #43
This file contains 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: Release | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- dev | |
pull_request: | |
branches: | |
- main | |
- dev | |
jobs: | |
release: | |
name: Release | |
permissions: write-all | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
# Make sure the release step uses its own credentials: | |
# https://github.com/cycjimmy/semantic-release-action#private-packages | |
fetch-depth: 0 | |
- name: Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ runner.home }}/.gradle/caches | |
${{ runner.home }}/.gradle/wrapper | |
.gradle | |
build | |
node_modules | |
key: ${{ runner.os }}-gradle-npm-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'package-lock.json') }} | |
- name: Get last tag | |
id: last_tag | |
uses: oprypin/find-latest-tag@v1 | |
continue-on-error: true | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
repository: ${{ github.repository }} | |
releases-only: true | |
- name: Get next version code | |
id: next_ver_code | |
run: | | |
TAG="${{ steps.last_tag.outputs.tag }}" | |
echo $TAG | |
if [ -z "$TAG" ]; then TAG=0; fi | |
echo "NEXT_VER_CODE=$((TAG + 1))" >> $GITHUB_OUTPUT | |
- name: Build modules/APKs | |
run: | | |
./gradlew build | |
cp ./patches.json ./build/libs/ | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_REPOSITORY: $GITHUB_REPOSITORY | |
NEXT_VER_CODE: ${{ steps.next_ver_code.outputs.NEXT_VER_CODE }} | |
- name: Upload modules to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
body: "Sample" | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ./build/libs/* | |
release_name: ReVanced | |
tag: ${{ steps.next_ver_code.outputs.NEXT_VER_CODE }} | |
file_glob: true | |
overwrite: true | |
- name: trigger revanced module | |
run: | | |
curl -H "Accept: application/vnd.github.everest-preview+json" \ | |
-H "Authorization: token ${{secrets.ACTION_KEY}}" \ | |
--request POST \ | |
--data '{"event_type": "revanced-patches repo trigger"}' \ | |
https://api.github.com/repos/xfilesee34/revanced/dispatches |