This repository has been archived by the owner on Jan 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
97 additions
and
57 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ on: | |
- "master" | ||
paths-ignore: | ||
- "*.md" | ||
- "release.yaml" | ||
|
||
workflow_dispatch: | ||
inputs: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,101 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
paths: | ||
- "CHANGELOG.md" | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- "master" | ||
paths: | ||
- "CHANGELOG.md" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
output: "${{ github.workspace }}/app/build/outputs/apk/release" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.20.3 | ||
cache: false | ||
cache-dependency-path: ${{ github.workspace }}/alist-lib/go.sum | ||
|
||
- uses: actions/cache@v3 | ||
name: Cache Go Modules | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
go- | ||
- name: Build Alist-lib | ||
run: | | ||
cd alist-lib/scripts | ||
chmod +x *.sh | ||
if [ $product == "latestRelease" ]; then | ||
./install_alist.sh | ||
else | ||
./install_alist_commits.sh | ||
fi | ||
./install_web.sh | ||
go install golang.org/x/mobile/cmd/gomobile@latest | ||
gomobile init | ||
go get golang.org/x/mobile/bind | ||
./install_aar.sh all | ||
- name: Setup Gradle | ||
uses: gradle/[email protected] | ||
|
||
- name: Init Signature | ||
run: | | ||
touch local.properties | ||
echo ALIAS_NAME='${{ secrets.ALIAS_NAME }}' >> local.properties | ||
echo ALIAS_PASSWORD='${{ secrets.ALIAS_PASSWORD }}' >> local.properties | ||
echo KEY_PASSWORD='${{ secrets.KEY_PASSWORD }}' >> local.properties | ||
echo KEY_PATH='./key.jks' >> local.properties | ||
# 从Secrets读取无换行符Base64解码, 然后保存到到app/key.jks | ||
echo ${{ secrets.KEY_STORE }} | base64 --decode > $GITHUB_WORKSPACE/app/key.jks | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Build with Gradle | ||
run: ./gradlew assembleRelease -build-cache --parallel --daemon --warning-mode all | ||
|
||
- name: Init APP Version Name | ||
run: | | ||
echo "ver_name=$(grep -m 1 'versionName' ${{ env.output }}/output-metadata.json | cut -d\" -f4)" >> $GITHUB_ENV | ||
- name: Upload App To Artifact | ||
if: success () || failure () | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: "AlistAndroid_${{env.ver_name}}" | ||
path: ${{ env.output }}/*.apk | ||
|
||
- name: Make "CHANGELOG.md" | ||
run: | | ||
echo "\n\n## 未知CPU架构?请优先选择体积最大的APK" >> ${{ github.workspace }}/CHANGELOG.md | ||
- uses: softprops/[email protected] | ||
with: | ||
name: ${{ env.ver_name }} | ||
tag_name: ${{ env.ver_name }} | ||
body_path: ${{ github.workspace }}/CHANGELOG.md | ||
draft: false | ||
prerelease: false | ||
files: ${{ env.output }}/*.apk | ||
env: | ||
output: "${{ github.workspace }}/app/build/outputs/apk/release" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/[email protected] | ||
|
||
- name: Init Signature | ||
run: | | ||
touch local.properties | ||
echo ALIAS_NAME='${{ secrets.ALIAS_NAME }}' >> local.properties | ||
echo ALIAS_PASSWORD='${{ secrets.ALIAS_PASSWORD }}' >> local.properties | ||
echo KEY_PASSWORD='${{ secrets.KEY_PASSWORD }}' >> local.properties | ||
echo KEY_PATH='./key.jks' >> local.properties | ||
# 从Secrets读取无换行符Base64解码, 然后保存到到app/key.jks | ||
echo ${{ secrets.KEY_STORE }} | base64 --decode > $GITHUB_WORKSPACE/app/key.jks | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Build with Gradle | ||
run: ./gradlew assembleRelease -build-cache --parallel --daemon --warning-mode all | ||
|
||
- name: Init APP Version Name | ||
run: | | ||
echo "ver_name=$(grep -m 1 'versionName' ${{ env.output }}/output-metadata.json | cut -d\" -f4)" >> $GITHUB_ENV | ||
- name: Upload App To Artifact | ||
if: success () || failure () | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: "TtsDictEditor_${{env.ver_name}}" | ||
path: ${{ env.output }}/*.apk | ||
|
||
- uses: softprops/[email protected] | ||
with: | ||
name: ${{ env.ver_name }} | ||
tag_name: ${{ env.ver_name }} | ||
body_path: ${{ github.workspace }}/CHANGELOG.md | ||
draft: false | ||
prerelease: false | ||
files: ${{ env.output }}/*.apk | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
系统通知内容中支持显示局域网IP |