Skip to content

Commit

Permalink
Fixes #6 - Add trigger workflow (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnriem authored Jul 7, 2024
1 parent 3b9fc4e commit 77d835e
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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_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

0 comments on commit 77d835e

Please sign in to comment.