Skip to content

Release types

Release types #8

Workflow file for this run

name: Release types
on:
workflow_dispatch:
inputs:
type:
type: choice
description: Release type
required: true
options:
- major
- minor
- patch
default: patch
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get next version
uses: rmeneely/git-next-version@v1
with:
tag_pattern: 'types_v[0-9]*.[0-9]*.[0-9]*'
increment: ${{ inputs.type }}
- name: Format version
id: format
uses: mad9000/actions-find-and-replace-string@5
with:
source: ${{ env.NEXT_VERSION }}
find: 'types_v'
replace: ''
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Cache
uses: actions/cache@v4
with:
path: |
**/node_modules
~/.gradle/caches
~/.gradle/wrapper
key: 11-node-${{ hashFiles('**/package-lock.json') }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: 11-
- name: Publish artifacts
run: ./gradlew clean types:publish -x test -PreleaseVersion=${{steps.format.outputs.value}}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: "types/build/libs/types-*"
allowUpdates: true
generateReleaseNotes: true
commit: main
tag: ${{ env.NEXT_VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}