Skip to content

release

release #14

Workflow file for this run

name: release
on:
workflow_dispatch:
inputs:
snapshot-build:
description: 'Snapshot build (y/n)?'
required: true
default: 'y'
release-tag:
description: 'Release Tag (only if not snapshot)'
required: false
default: 'services_XXX'
jobs:
release-services:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Java and Maven
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'adopt'
- name: Remove SNAPSHOT
if: github.event.inputs.snapshot-build == 'n'
run: |
mvn versions:set --batch-mode -DremoveSnapshot -DprocessAllModules
- name: Release Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
gpg_private_key: ${{ secrets.pgp_private_key }}
gpg_passphrase: ${{ secrets.pgp_private_key_secret }}
nexus_username: ${{ secrets.nexus_username }}
nexus_password: ${{ secrets.nexus_password }}
github-release:
name: Create Release
if: github.event.inputs.snapshot-build == 'n'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create tag
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ github.event.inputs.release-tag }}',
sha: context.sha
})
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.release-tag }}
release_name: Release ${{ github.event.inputs.release-tag }}
draft: false
prerelease: false