generated from Kotlin/KMP-App-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (52 loc) · 1.73 KB
/
AndroidBuild.yml
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
name: CI/CD
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
androidBuild:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.0
- name: Setup Java SDK
uses: actions/setup-java@v3.13.0
with:
distribution: 'adopt'
java-version: '17'
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Build Android with Gradle
run: ./gradlew :composeApp:assembleDebug
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.3
with:
name: ResistorCalculator-KMP.apk
path: composeApp/build/outputs/apk/debug/composeApp-debug.apk
createRelease:
needs: androidBuild
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4.1.0
- name: Set Git Identity
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
- name: Determine Version
id: determine_version
run: echo "::set-output name=version::$(date +'%Y%m%d%H%M%S')"
- name: Create Temporary Tag
run: git tag -a temp-${{ steps.determine_version.outputs.version }} -m "Temporary Tag"
- name: Push Temporary Tag
run: git push origin temp-${{ steps.determine_version.outputs.version }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: composeApp/build/outputs/apk/debug/composeApp-debug.apk
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: temp-${{ steps.determine_version.outputs.version }}
title: Release ${{ steps.determine_version.outputs.version }}