From 9ed41d7b4d92da6be1bc71b29c443c35721f2470 Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Sun, 10 Jul 2022 10:35:08 +0200 Subject: [PATCH] Release job and automatic changelog --- .github/changelog-configuration.json | 32 +++++++++++++++++++ .github/workflows/release.yml | 47 ++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 .github/changelog-configuration.json create mode 100644 .github/workflows/release.yml diff --git a/.github/changelog-configuration.json b/.github/changelog-configuration.json new file mode 100644 index 00000000..31dda4f4 --- /dev/null +++ b/.github/changelog-configuration.json @@ -0,0 +1,32 @@ +{ + "categories": [ + { + "title": "## 💡 Features", + "labels": [ + "feature", + "enhancement" + ] + }, + { + "title": "## 🐛 Fixes", + "labels": [ + "fix", + "bug" + ] + }, + { + "title": "## 💬 Maintenance", + "labels": [ + "maintenance" + ] + } + ], + "ignore_labels": [ + "dependencies", + "gradle-wrapper" + ], + "sort": "ASC", + "template": "${{CHANGELOG}}", + "pr_template": "- ${{TITLE}} #${{NUMBER}}", + "empty_template": "- no changes" +} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..66deeae6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: Changelog vs Release + +on: + push: + tags: + - '*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Build Changelog + id: github_release + uses: mikepenz/release-changelog-builder-action@main + with: + configuration: ".github/changelog-configuration.json" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Install JDK ${{ matrix.java_version }} + uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: 11 + - name: Build project + run: ./gradlew assembleRelease + env: + VERSION: ${{ github.ref }} + - name: Get the version + id: tagger + uses: jimschubert/query-tag-action@v2 + with: + skip-unshallow: 'true' + abbrev: false + commit-ish: HEAD + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{steps.tagger.outputs.tag}} + name: ${{steps.tagger.outputs.tag}} + body: ${{steps.github_release.outputs.changelog}} + files: touchview/build/outputs/aar/touchview-release.aar + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}