Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
jing332 committed Aug 16, 2023
1 parent aae1b12 commit 99bf79e
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 57 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- "master"
paths-ignore:
- "*.md"
- "release.yaml"

workflow_dispatch:
inputs:
Expand Down
152 changes: 95 additions & 57 deletions .github/workflows/release.yaml
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 }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
系统通知内容中支持显示局域网IP

0 comments on commit 99bf79e

Please sign in to comment.