Skip to content

Commit

Permalink
Merge pull request #807 from walt-id/feat/ci-dev-version
Browse files Browse the repository at this point in the history
ci: add optional release-version input for test-deployment
  • Loading branch information
mikeplotean authored Oct 23, 2024
2 parents 2988a57 + 040b44c commit 2d4973b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ name: Deploy manually to test environment

on:
workflow_dispatch:

inputs:
release_version:
description: 'Custom version'
required: false
jobs:
build:
name: "Deploy to test environment"
Expand All @@ -16,9 +19,15 @@ jobs:
- uses: actions/checkout@v3
- name: Calculate release version
run: |
BRANCH=$(echo ${{ github.ref }} | sed -e 's/refs\/heads\///' -e 's/\//-/g')
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
echo "release_version=1.0.$(date +'%g%m%d%H%M')-${BRANCH}" >> $GITHUB_ENV
if [ "${{ inputs.release_version }}" == "" ]; then
echo "Using computed value"
BRANCH=$(echo ${{ github.ref }} | sed -e 's/refs\/heads\///' -e 's/\//-/g')
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
echo "release_version=1.0.$(date +'%g%m%d%H%M')-${BRANCH}" >> $GITHUB_ENV
else
echo "Using provided input"
echo "release_version=${{ inputs.release_version }}" >> $GITHUB_ENV
fi
- name: Set version
run: |
sed -i "s/1.0.0-SNAPSHOT/${{ env.release_version }}/g" build.gradle.kts
Expand Down

0 comments on commit 2d4973b

Please sign in to comment.