Skip to content

Commit

Permalink
ci: add optional release-version input for test-deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeplotean committed Oct 22, 2024
1 parent d3a3fc8 commit 040b44c
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 040b44c

Please sign in to comment.