Skip to content

feat(build): generate ChangeLog from ConventionalCommit #26

feat(build): generate ChangeLog from ConventionalCommit

feat(build): generate ChangeLog from ConventionalCommit #26

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