Skip to content

Release on Tag

Release on Tag #21

Workflow file for this run

name: Release on Tag
permissions:
contents: write
packages: write
on:
push:
tags:
- 'release-*'
workflow_dispatch:
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Build with Maven
run: mvn clean package
- name: Extract Release Info
id: release_info
run: |
echo "Reading release_info.info..."
VERSION=$(awk -F= '/^VERSION=/ {print $2}' release_info.info)
DESCRIPTION=$(awk '/^DESCRIPTION=/,EOF' release_info.info | sed '1 s/DESCRIPTION=//' | sed ':a;N;$!ba;s/\n/%0A/g')
echo "::set-output name=version::${VERSION}"
echo "::set-output name=description::${DESCRIPTION}"
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.release_info.outputs.version }}
name: Release ${{ steps.release_info.outputs.version }}
body: ${{ steps.release_info.outputs.description }}
files: target/*.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}