-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (33 loc) · 1.6 KB
/
Copy pathrelease.yml
File metadata and controls
36 lines (33 loc) · 1.6 KB
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
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Release
on: [ push ]
jobs:
build:
if: startsWith(github.event.head_commit.message, 'Release ')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Java 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: adopt-hotspot
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: "Get data"
id: metadata
run: |
echo ::set-output name=VERSION::$(php -r 'echo explode("+", explode("-", yaml_parse_file(getcwd() . DIRECTORY_SEPARATOR . "src/main/resources/version.yml")["version"])[0])[0];')
echo ::set-output name=FULL_VERSION::$(php -r 'echo yaml_parse_file(getcwd() . DIRECTORY_SEPARATOR . "src/main/resources/version.yml")["version"];')
echo ::set-output name=NAME::$(php -r 'echo yaml_parse_file(getcwd() . DIRECTORY_SEPARATOR . "src/main/resources/version.yml")["name"];')
- name: Upload release
if: github.ref == 'refs/heads/master'
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ steps.metadata.outputs.VERSION }}"
prerelease: false
title: "Release v${{ steps.metadata.outputs.VERSION }}"
files: |
target/asynclib-1.0.0.jar