Prepare and create new tag #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Prepare and create new tag' | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
type: string | |
required: true | |
description: 'Semantic version string, format: /\d+\.\d+\.\d+/' | |
jobs: | |
tag: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Validate inputs | |
run: echo "${{ github.event.inputs.version }}" | grep -E "^[0-9]+\.[0-9]+\.[0-9]+$" | |
- name: Setup Maven | |
uses: s4u/[email protected] | |
with: | |
checkout-token: ${{ secrets.API_TOKEN }} | |
checkout-persist-credentials: true | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: 'npm' | |
cache-dependency-path: 'package-lock.json' | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.GPG_KEY_PRIVATE }} | |
passphrase: ${{ secrets.GPG_KEY_PASSPHRASE }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
- name: Update artifact version in pom.xml | |
run: mvn versions:set -DnewVersion=${{ github.event.inputs.version }} | |
- name: Update artifact version in package.json | |
run: npm version ${{ github.event.inputs.version }} --no-git-tag-version --force | |
- name: Create and push tag | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: '[ "pom.xml", "package.json", "package-lock.json" ]' | |
commit: '-S' | |
author_name: 'seart-bot' | |
author_email: '[email protected]' | |
message: 'New release: ${{ github.event.inputs.version }}' | |
tag: 'v${{ github.event.inputs.version }} --force' | |
tag_push: '--force' |