-
Notifications
You must be signed in to change notification settings - Fork 19
45 lines (38 loc) · 1.26 KB
/
publish_jar.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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 }}