trigger #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v2 | |
with: | |
token: ${{ secrets.GIT_TOKEN }} | |
- 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 }} | |
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 "noreply@manorrock.com" | |
git config --global user.name "Automated release" | |
git commit -a -m "Releasing version $VERSION" | |
git tag v$VERSION -f | |
git push origin v$VERSION -f | |
git checkout $BRANCH | |
git branch -D release |