Skip to content

Commit b583b24

Browse files
author
OpenCode Bot
committed
ci: add build workflow
1 parent f7507d2 commit b583b24

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/build.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Set up JDK
18+
uses: actions/setup-java@v4
19+
with:
20+
distribution: 'temurin'
21+
java-version: '17'
22+
23+
- name: Setup Android SDK
24+
uses: android-actions/setup-android@v2
25+
26+
- name: Create keystore.properties
27+
run: |
28+
echo "storeFile=debug.jks" > keystore.properties
29+
echo "storePassword=android" >> keystore.properties
30+
echo "keyAlias=android" >> keystore.properties
31+
echo "keyPassword=android" >> keystore.properties
32+
33+
- name: Grant execute permission
34+
run: chmod +x gradlew
35+
36+
- name: Build Release APK
37+
run: ./gradlew assembleRelease --no-daemon 2>&1
38+
39+
- name: Upload APK
40+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
41+
uses: softprops/action-gh-release@v2
42+
with:
43+
files: releases/*.apk
44+
generate_release_notes: true
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: Upload Artifact
49+
if: github.event_name == 'workflow_dispatch'
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: androidforclaw-apk
53+
path: releases/*.apk

0 commit comments

Comments
 (0)