Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ template: |
# What's Changed

$CHANGES

**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$RESOLVED_VERSION

categories:
- title: 'New Features'
labels:
Expand All @@ -14,7 +17,7 @@ categories:
- 'bug'
- 'fix'
- title: 'Maintenance'
label:
labels:
- 'ci'
- 'chore'
- 'perf'
Expand All @@ -27,7 +30,6 @@ categories:
label: 'dependencies'
exclude-labels:
- 'skip-changelog'
change-template: '* $TITLE (#$NUMBER)'
version-resolver:
major:
labels:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
workflow_dispatch:

jobs:
update_release_draft:
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: false

jobs:
release:
name: Release
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Assign input version
if: github.event.inputs.version != null
run: echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV

- uses: actions/github-script@v7
if: github.event.inputs.version == null
id: candidate-version
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: |
const list = await github.rest.repos.listReleases({
owner: "domaframework",
repo: "doma-codegen-plugin",
});
console.log(list)
let version = list.data[0].name
return version.startsWith("v") ? version.substring(1) : version

- name: Assign candidate version
if: github.event.inputs.version == null
run: echo "RELEASE_VERSION=${{ steps.candidate-version.outputs.result }}" >> $GITHUB_ENV

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21

- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Release ${{ env.RELEASE_VERSION }}
run: |
java -version
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
./gradlew release -Prelease.releaseVersion=${{ env.RELEASE_VERSION }}

- name: Upload reports
if: failure()
uses: actions/upload-artifact@v4
with:
name: build
path: ./**/build/reports
Loading