-
Notifications
You must be signed in to change notification settings - Fork 3
54 lines (51 loc) · 1.81 KB
/
release.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
46
47
48
49
50
51
52
53
54
# 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: Branch Release
on:
workflow_dispatch:
inputs:
release_version:
description: 'Release Version'
required: true
default: '0.9.0'
next_version:
description: 'Next Snapshot Version'
required: true
default: '0.9.1-SNAPSHOT'
jobs:
printInputs:
runs-on: ubuntu-latest
steps:
- run: |
echo "Release Version: ${{ github.event.inputs.release_version }}"
echo "Next Version: ${{ github.event.inputs.next_version }}"
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.GIT_RELEASE_TOKEN }}
- name: Set up JDK 1.11
uses: actions/setup-java@v1
with:
java-version: 1.11
- name: Release Version
run: |
mvn versions:set -DnewVersion=${{ github.event.inputs.release_version }} -DgenerateBackupPoms=false
git config user.name "Manager of Releases"
git config user.email [email protected]
git add .
git commit -m "Release Version ${{ github.event.inputs.release_version }}"
git tag v${{ github.event.inputs.release_version }}
- name: Prepare Snapshot
run: |
mvn versions:set -DnewVersion=${{ github.event.inputs.next_version }} -DgenerateBackupPoms=false
git config user.name "Manager of Releases"
git config user.email [email protected]
git add .
git commit -m "Prepare Snapshot Version ${{ github.event.inputs.next_version }}"
- name: Push Release and Snapshot
run: |
git push
git push origin v${{ github.event.inputs.release_version }}