Skip to content

Commit d39ccb4

Browse files
authored
Merge pull request #67 from layer5io/leecalcote-patch-5
Update multi-platform workflow for input management
2 parents 714e768 + 43ce9d9 commit d39ccb4

File tree

1 file changed

+24
-27
lines changed

1 file changed

+24
-27
lines changed

.github/workflows/multi-platform.yml

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,60 +10,56 @@ on:
1010
# paths-ignore:
1111
# - "docs/**"
1212
# - '.github/**'
13-
workflow_dispatch:
13+
workflow_call:
1414
inputs:
15+
RELEASE_CHANNEL:
16+
description: "Release channel (stable or edge)"
17+
required: true
18+
type: string
19+
default: "stable"
1520
release-ver:
1621
description: "Stable Release Version"
1722
required: true
1823
default: "v"
19-
stripped-release-ver:
20-
description: "Stripped Stable Release Version"
21-
required: true
22-
default: ""
23-
release-channel:
24-
description: "Release Channel"
24+
type: string
25+
26+
workflow_dispatch:
27+
inputs:
28+
RELEASE_CHANNEL:
29+
description: "Release channel (stable or edge)"
2530
required: true
31+
type: string
2632
default: "stable"
33+
release-ver:
34+
description: "Stable Release Version"
35+
required: true
36+
default: "v"
37+
type: string
2738

2839
env:
2940
GIT_VERSION: ${{github.event.inputs.release-ver}}
30-
GIT_STRIPPED_VERSION: ${{github.event.inputs.stripped-release-ver}}
31-
RELEASE_CHANNEL: ${{github.event.inputs.release-channel || inputs.release_channel }}
32-
GIT_TAG: ${{ github.event.release.tag_name }}
41+
RELEASE_CHANNEL: ${{github.event.inputs.RELEASE_CHANNEL || inputs.RELEASE_CHANNEL }}
3342

3443
jobs:
3544
print-inputs:
3645
runs-on: ubuntu-latest
3746
steps:
3847
- run: |
39-
echo "Dispatched GIT_VERSION: ${{github.event.inputs.release-ver}}"
40-
echo " Dispatched GIT_STRIPPED_VERSION: ${{github.event.inputs.stripped-release-ver}}"
4148
echo "Env RELEASE_CHANNEL: ${{env.RELEASE_CHANNEL}}"
4249
echo "Env GIT_VERSION: ${{env.GIT_VERSION}}"
43-
echo "Env GIT_STRIPPED_VERSION: ${{env.GIT_STRIPPED_VERSION}}"
44-
echo "Env GIT_TAG: ${{ github.event.release.tag_name }}"
4550
4651
docker-build:
4752
runs-on: ubuntu-latest
4853
steps:
4954
- name: Checkout repo
5055
uses: actions/checkout@v4
5156
- name: Identify Release Values
52-
if: "${{ github.event.inputs.release-ver}} != 'v' }}"
5357
run: |
54-
# GIT_REF=`git symbolic-ref HEAD`
55-
if [[ $GIT_TAG = refs/tags* ]]
56-
then
57-
echo "RELEASE_CHANNEL=stable" >> $GITHUB_ENV
58-
else
59-
echo "RELEASE_CHANNEL=edge" >> $GITHUB_ENV
60-
fi
61-
echo "Release channel determined to be $RELEASE_CHANNEL"
62-
LATEST_VERSION=$(git ls-remote --tags | tail -1 | cut -f2 | sed 's/refs\/tags\///g')
63-
GIT_VERSION=$(git ls-remote --tags | tail -1 | cut -f2 | sed 's/refs\/tags\///g')
58+
# LATEST_VERSION=$(git ls-remote --tags | tail -1 | cut -f2 | sed 's/refs\/tags\///g')
59+
# GIT_VERSION=$(git ls-remote --tags | tail -1 | cut -f2 | sed 's/refs\/tags\///g')
6460
# GIT_VERSION=$(git describe --tags `git rev-list --tags --max-count=1` --always)
65-
GIT_STRIPPED_VERSION=$(git ls-remote --tags | tail -1 | cut -f2 | sed 's/refs\/tags\///g' | cut -c2-)
66-
echo "GIT_LATEST=$LATEST_VERSION" >> $GITHUB_ENV
61+
GIT_STRIPPED_VERSION=$(echo $GIT_VERSION | cut -c2-)
62+
# echo "GIT_LATEST=$LATEST_VERSION" >> $GITHUB_ENV
6763
echo "GIT_VERSION=$GIT_VERSION" >> $GITHUB_ENV
6864
echo "GIT_STRIPPED_VERSION=$GIT_STRIPPED_VERSION" >> $GITHUB_ENV
6965
shell: bash
@@ -72,6 +68,7 @@ jobs:
7268
id: release_notes
7369
run: |
7470
RELEASE_NOTES=$(gh release create ${{ github.ref_name }} --generate-notes --repo ${{ github.repository }} | tail -n +2) # Get generated release notes, excluding the first line
71+
RELEASE_NOTES="$RELEASE_NOTES\nSee https://docs.layer5.io/kanvas/reference/releases/$GIT_VERSION"
7572
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
7673
echo "$RELEASE_NOTES" >> $GITHUB_ENV
7774
echo "EOF" >> $GITHUB_ENV

0 commit comments

Comments
 (0)