Skip to content

Commit b998e25

Browse files
committed
Initial commit
0 parents  commit b998e25

File tree

87 files changed

+11768
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+11768
-0
lines changed

.github/workflows/Build-Apk.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build-Apk
2+
3+
on:
4+
workflow_dispatch:
5+
6+
push:
7+
branches:
8+
- '**'
9+
paths-ignore:
10+
- 'LICENSE'
11+
- '*.md'
12+
- '.github/**'
13+
14+
jobs:
15+
build:
16+
if: ${{ !startsWith(github.event.head_commit.message, 'chore:') && !startsWith(github.event.head_commit.message, 'chore(') }}
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v5
20+
21+
- uses: actions/setup-java@v5
22+
with:
23+
distribution: 'zulu'
24+
java-version: '21'
25+
26+
- uses: gradle/actions/setup-gradle@v5
27+
with:
28+
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
29+
30+
- name: write secrets info
31+
run: |
32+
echo keystore.password='${{ secrets.STORE_PASSWORD }}' >> signing.properties
33+
echo key.alias='${{ secrets.KEY_ALIAS }}' >> signing.properties
34+
echo key.password='${{ secrets.KEY_PASSWORD }}' >> signing.properties
35+
- run: chmod +x gradlew
36+
- run: ./gradlew app:assembleRelease
37+
38+
- uses: actions/upload-artifact@v4
39+
with:
40+
name: release
41+
path: app/build/outputs/apk/release
42+
43+
- uses: actions/upload-artifact@v4
44+
with:
45+
name: outputs
46+
path: app/build/outputs
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Build-Release
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v5
13+
14+
- uses: actions/setup-java@v5
15+
with:
16+
distribution: 'zulu'
17+
java-version: '21'
18+
19+
- uses: gradle/actions/setup-gradle@v5
20+
with:
21+
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
22+
23+
- name: write secrets info
24+
run: |
25+
echo keystore.password='${{ secrets.STORE_PASSWORD }}' >> signing.properties
26+
echo key.alias='${{ secrets.KEY_ALIAS }}' >> signing.properties
27+
echo key.password='${{ secrets.KEY_PASSWORD }}' >> signing.properties
28+
- run: chmod +x gradlew
29+
- run: ./gradlew app:assembleRelease
30+
31+
- uses: actions/upload-artifact@v4
32+
with:
33+
name: release
34+
path: app/build/outputs/apk/release
35+
36+
- uses: actions/upload-artifact@v4
37+
with:
38+
name: outputs
39+
path: app/build/outputs
40+
41+
- uses: actions/upload-artifact@v4
42+
with:
43+
name: CHANGELOG.md
44+
path: CHANGELOG.md
45+
46+
release:
47+
needs: build
48+
permissions: write-all
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/download-artifact@v4
52+
with:
53+
name: outputs
54+
path: outputs
55+
56+
- uses: actions/download-artifact@v4
57+
with:
58+
name: release
59+
path: release
60+
61+
- uses: actions/download-artifact@v4
62+
with:
63+
name: CHANGELOG.md
64+
65+
- run: ls -R
66+
67+
- id: create_release
68+
uses: actions/create-release@v1
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
with:
72+
tag_name: ${{ github.ref_name }}
73+
release_name: Release ${{ github.ref_name }}
74+
body_path: ./CHANGELOG.md
75+
prerelease: ${{ contains(github.ref_name, 'beta') }}
76+
77+
- name: Find and upload APK
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
run: |
81+
APK_PATH=$(find release -name "AutoGLM-*-release.apk" -type f | head -1)
82+
if [ -z "$APK_PATH" ]; then
83+
echo "Error: APK file not found"
84+
exit 1
85+
fi
86+
echo "Found APK: $APK_PATH"
87+
curl -X POST \
88+
-H "Authorization: token $GITHUB_TOKEN" \
89+
-H "Content-Type: application/vnd.android.package-archive" \
90+
--data-binary @"$APK_PATH" \
91+
"${{ steps.create_release.outputs.upload_url }}?name=AutoGLM-${{ github.ref_name }}.apk"
92+
93+
- run: zip -r outputs.zip outputs
94+
- uses: actions/upload-release-asset@v1
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
with:
98+
upload_url: ${{ steps.create_release.outputs.upload_url }}
99+
asset_path: outputs.zip
100+
asset_name: outputs-${{ github.ref_name }}.zip
101+
asset_content_type: application/zip

0 commit comments

Comments
 (0)