Skip to content

Commit

Permalink
feat(build): generate ChangeLog from ConventionalCommit
Browse files Browse the repository at this point in the history
  • Loading branch information
stonebuzz committed Aug 24, 2023
1 parent 8053cee commit 3dc69d8
Show file tree
Hide file tree
Showing 5 changed files with 2,380 additions and 7 deletions.
36 changes: 29 additions & 7 deletions .github/workflows/release-new-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,22 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "Extract tag name"
run: |
echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- uses: actions/checkout@v3
- 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:
Expand All @@ -32,19 +44,29 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# Build app
- name: Build with Gradle
run: ./gradlew build
- name: Build inventory with Gradle
run: ./gradlew :inventory:build
# Build app
- name: Build example_java with Gradle
run: ./gradlew :example_java:build
# Build app example_kotlin
- name: Build example_kotlin with Gradle
run: ./gradlew :example_kotlin:build

#####################
# Prepare release #
#####################

- name: "Extract clean git log (conventianl commits)"
run: echo "release_body=$(echo ./vendor/bin/robo build:log ${{ env.previous_tag_name }} HEAD 0)" >> $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
generate_release_notes : 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
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ node_modules
/captures
.externalNativeBuild
/development

/vendor/*
Loading

0 comments on commit 3dc69d8

Please sign in to comment.