Skip to content

Release

Release #21

Workflow file for this run

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@v6
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",
});
console.log(list)
return list.data[0].name
- name: Assign candidate version
if: github.event.inputs.version == null
run: echo "RELEASE_VERSION=${{ steps.candidate-version.outputs.result }}" >> $GITHUB_ENV
- name: Set up the latest LTS JDK
uses: actions/setup-java@v3
with:
distribution: ${{ vars.JDK_DISTRIBUTION }}
java-version: ${{ vars.LATEST_LTS_JDK_VERSION }}
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
- name: Prepare git config
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Set up Gradle
uses: gradle/[email protected]
- name: Release ${{ env.RELEASE_VERSION }}
run: >
./gradlew
-Prelease.releaseVersion=${{ env.RELEASE_VERSION }}
release
- name: Upload reports
if: failure()
uses: actions/upload-artifact@v3
with:
name: build
path: ./**/build/reports