-
Notifications
You must be signed in to change notification settings - Fork 22
72 lines (62 loc) · 2.16 KB
/
release-new-version.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
65
66
67
68
69
70
71
72
name: "GLPI Android Inventory Library Release"
env:
module_java: example_java
module_kotlin: example_kotlin
module_inventory: inventory
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Fetch repository
uses: actions/checkout@v3
with:
fetch-depth: 0 #To Fetch All Tags and Branches
- name: Install dependencies
uses: php-actions/composer@v6
with:
dev: no
- name: "Extract current tag name"
run: echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Extract previous tag name
run: echo "previous_tag_name=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=2 --max-count=1`)" >> $GITHUB_ENV
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle
##############################################
# Prepare / Build project APK / AAR / JAR #
##############################################
# Grant execute permission for gradlew
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# Build app
- name: Build project APK / AAR / JAR
run: ./gradlew build
#####################
# Prepare release #
#####################
- name: "Extract clean git log (conventianl commits)"
run: |
{
echo 'release_body<<EOF'
./vendor/bin/robo build:log ${{ env.previous_tag_name }} HEAD 0
echo EOF
} >> "$GITHUB_ENV"
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name : Inventory Engine v${{ env.tag_name }}
draft : true
body : ${{ env.release_body }}
files: |
${{ env.module_java }}/build/outputs/apk/release/${{ env.module_java }}-release-unsigned.apk
${{ env.module_kotlin }}/build/outputs/apk/release/${{ env.module_kotlin }}-release-unsigned.apk
${{ env.module_inventory }}/build/outputs/aar/${{ env.module_inventory }}-release.aar
${{ env.module_inventory }}/build/libs/${{ env.module_inventory }}-sources.jar