Skip to content

Commit 5cb68e9

Browse files
authored
chore: Generate changelog automatically
1 parent e9fd476 commit 5cb68e9

File tree

3 files changed

+97
-18
lines changed

3 files changed

+97
-18
lines changed

.github/actions/build/action.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build HTML-Attribute-Folder
2+
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Setup Java
7+
uses: actions/setup-java@v4
8+
with:
9+
distribution: 'oracle'
10+
java-version: ${{ inputs.java_version }}
11+
12+
- name: Setup Gradle
13+
uses: gradle/actions/setup-gradle@v4
14+
15+
- name: Build PlugIn
16+
shell: bash
17+
run: ./gradlew buildPlugin
18+
19+
- name: Release PlugIn
20+
uses: ncipollo/release-action@v1
21+
with:
22+
token: ${{ inputs.github_token }}
23+
artifacts: "build/distributions/html-attribute-folder-*.zip"
24+
name: "html-attribute-folder-${{ inputs.version }}.zip"
25+
26+
inputs:
27+
github_token:
28+
description: Access Token for GitHub
29+
required: true
30+
version:
31+
description: Version of the Release
32+
required: true
33+
java_version:
34+
description: Java version to use
35+
required: false
36+
default: "21"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Generate HTML-Attribute-Changelog
2+
3+
runs:
4+
using: "composite"
5+
steps:
6+
- uses: BobAnkh/auto-generate-changelog@v1.2.5
7+
with:
8+
ACCESS_TOKEN: ${{ inputs.github_token }}
9+
COMMIT_MESSAGE: "docs(changelog): 📚 Update release notes for ${{ inputs.version }}"
10+
TYPE: "feat:Feature,fix:Fixes,docs:Documentation"
11+
BRANCH: ${{ inputs.branch_name }}
12+
13+
inputs:
14+
github_token:
15+
description: Access Token for GitHub
16+
required: true
17+
version:
18+
description: Version of the Release
19+
required: true
20+
branch_name:
21+
description: Name of the branch
22+
required: true

.github/workflows/buildRelease.yml

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,52 @@
1-
name: Build HTML-Attribute-Folder
1+
name: Build and Release HTML-Attribute-Folder
22
on:
33
push:
44
tags:
55
- 'v*'
6+
67
jobs:
7-
build-gradle-project:
8+
build:
89
runs-on: ubuntu-latest
910
permissions:
1011
contents: write
1112
steps:
12-
- name: Get the version
13-
id: get_version
14-
run: echo "TAGGED_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
1513
- name: Checkout project sources
1614
uses: actions/checkout@v4
17-
- name: Setup Java
18-
uses: actions/setup-java@v4
1915
with:
20-
distribution: 'oracle'
21-
java-version: 17
22-
- name: Setup Gradle
23-
uses: gradle/actions/setup-gradle@v4
24-
- name: Build PlugIn
25-
run: ./gradlew buildPlugin
26-
- name: Release PlugIn
27-
uses: ncipollo/release-action@v1
16+
fetch-depth: 0
17+
fetch-tags: true
18+
ref: ${{ github.ref }}
19+
20+
- name: Get the version
21+
id: versions
22+
run: echo "TAGGED_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
23+
24+
- name: Get branch data
25+
uses: tj-actions/branch-names@v7
26+
id: branches
27+
28+
- name: Debug
29+
shell: bash
30+
run: |
31+
echo "Version: ${{ steps.versions.outputs.TAGGED_VERSION }}"
32+
echo "Branch : ${{ steps.branches.outputs.base_ref_branch || steps.branches.outputs.current_branch }}"
33+
34+
- name: Build and Release
35+
uses: ./.github/actions/build
36+
with:
37+
github_token: ${{ secrets.GITHUB_TOKEN }}
38+
version: ${{ steps.versions.outputs.TAGGED_VERSION }}
39+
40+
- name: Create changelog
41+
uses: ./.github/actions/changelog
42+
with:
43+
github_token: ${{ secrets.GITHUB_TOKEN }}
44+
version: ${{ steps.versions.outputs.TAGGED_VERSION }}
45+
branch_name: ${{ steps.branches.outputs.base_ref_branch || steps.branches.outputs.current_branch }}
46+
47+
- name: Update tag
48+
uses: rickstaa/action-create-tag@v1
2849
with:
29-
token: ${{ secrets.GITHUB_TOKEN }}
30-
artifacts: "build/distributions/html-attribute-folder-*.zip"
31-
name: "html-attribute-folder-${{ steps.get_version.outputs.TAGGED_VERSION }}.zip"
50+
tag: "v${{ steps.versions.outputs.TAGGED_VERSION }}"
51+
message: "Release ${{ steps.versions.outputs.TAGGED_VERSION }}"
52+
force_push_tag: "true"

0 commit comments

Comments
 (0)