-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (38 loc) · 1.84 KB
/
create-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
name: Create Release
on:
workflow_dispatch:
inputs:
NEW_RELEASE_VERSION:
description: 'Release version (without -SNAPSHOT)'
required: true
jobs:
create-release:
name: Create Release ${{ github.event.inputs.NEW_RELEASE_VERSION }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check new Version Number
run: bash ./.github/check-new-version-number.sh "${{ github.event.inputs.NEW_RELEASE_VERSION }}"
- name: Configure Git
run: |
git config --global user.name 'Thibault Meyer'
git config --global user.email 'thibaultmeyer@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
- name: Create Release ${{ github.event.inputs.NEW_RELEASE_VERSION }}
run: |
mvn versions:set -DnewVersion="${{ github.event.inputs.NEW_RELEASE_VERSION }}"
mvn versions:commit
git add .
git commit -m "Release ${{ github.event.inputs.NEW_RELEASE_VERSION }}"
git push
- name: Determine next SNAPSHOT
run: |
echo "NEXT_RELEASE_VERSION=$(echo ${{ github.event.inputs.NEW_RELEASE_VERSION }} | awk -F. -v OFS=. '{$NF += 1 ; print}')" >> $GITHUB_ENV
- name: Move to next SNAPSHOT
run: |
mvn versions:set -DnewVersion="${{ env.NEXT_RELEASE_VERSION }}-SNAPSHOT"
mvn versions:commit
git add .
git commit -m "Move to next SNAPSHOT"
git push