-
Notifications
You must be signed in to change notification settings - Fork 342
65 lines (60 loc) · 1.9 KB
/
Copy pathrelease.yml
File metadata and controls
65 lines (60 loc) · 1.9 KB
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
name: Build Release
on:
push:
branches:
- master
paths:
- 'CHANGELOG.md'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Remove old apk
run: |
rm -rf ./release/*
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 21
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build With Gradle
run: |
chmod +x gradlew
./gradlew assemblerelease --build-cache --parallel --warning-mode all
- name: Get VerName
run: |
echo "ver_name=$(grep 'versionName' release/output-metadata.json | cut -d\" -f4)" >> $GITHUB_ENV
- name: Upload App To Artifact
uses: actions/upload-artifact@v4
with:
name: TTS_${{ env.ver_name }}
path: ${{ github.workspace }}/release/*
- name: Release
uses: softprops/action-gh-release@v2
with:
name: TTS_${{ env.ver_name }}
tag_name: ${{ env.ver_name }}
body_path: ${{ github.workspace }}/CHANGELOG.md
draft: false
prerelease: false
files: ${{ github.workspace }}/release/*.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Git Push to release
run: |
cd ./release
git init
git checkout -b release
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
git add *.apk
git add *.json
git commit -m "${{ env.ver_name }}"
git push -f -u origin release