forked from ReVanced/revanced-patches-template
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (73 loc) · 2.35 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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