-
-
Notifications
You must be signed in to change notification settings - Fork 20
36 lines (36 loc) · 1.17 KB
/
trigger.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
name: trigger
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to release from'
required: true
default: 'current'
version:
description: 'Release version'
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
token: ${{ secrets.GIT_PASSWORD }}
- name: Release from given branch with given version
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
BRANCH=${{ github.event.inputs.branch }}
TAG=${GITHUB_REF}
VERSION=${{ github.event.inputs.version }}
echo "Releasing $VERSION from $BRANCH branch"
git checkout $BRANCH
git checkout -b release
mvn -B versions:set versions:commit -DnewVersion=$VERSION
git config --global user.email "[email protected]"
git config --global user.name "Automated release"
git commit -a -m "Releasing version $VERSION from $BRANCH branch"
git tag v$VERSION -f
git push origin v$VERSION -f
git checkout $BRANCH
git branch -D release