|
10 | 10 | # paths-ignore: |
11 | 11 | # - "docs/**" |
12 | 12 | # - '.github/**' |
13 | | - workflow_dispatch: |
| 13 | + workflow_call: |
14 | 14 | inputs: |
| 15 | + RELEASE_CHANNEL: |
| 16 | + description: "Release channel (stable or edge)" |
| 17 | + required: true |
| 18 | + type: string |
| 19 | + default: "stable" |
15 | 20 | release-ver: |
16 | 21 | description: "Stable Release Version" |
17 | 22 | required: true |
18 | 23 | 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)" |
25 | 30 | required: true |
| 31 | + type: string |
26 | 32 | default: "stable" |
| 33 | + release-ver: |
| 34 | + description: "Stable Release Version" |
| 35 | + required: true |
| 36 | + default: "v" |
| 37 | + type: string |
27 | 38 |
|
28 | 39 | env: |
29 | 40 | 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 }} |
33 | 42 |
|
34 | 43 | jobs: |
35 | 44 | print-inputs: |
36 | 45 | runs-on: ubuntu-latest |
37 | 46 | steps: |
38 | 47 | - run: | |
39 | | - echo "Dispatched GIT_VERSION: ${{github.event.inputs.release-ver}}" |
40 | | - echo " Dispatched GIT_STRIPPED_VERSION: ${{github.event.inputs.stripped-release-ver}}" |
41 | 48 | echo "Env RELEASE_CHANNEL: ${{env.RELEASE_CHANNEL}}" |
42 | 49 | 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 }}" |
45 | 50 |
|
46 | 51 | docker-build: |
47 | 52 | runs-on: ubuntu-latest |
48 | 53 | steps: |
49 | 54 | - name: Checkout repo |
50 | 55 | uses: actions/checkout@v4 |
51 | 56 | - name: Identify Release Values |
52 | | - if: "${{ github.event.inputs.release-ver}} != 'v' }}" |
53 | 57 | 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') |
64 | 60 | # 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 |
67 | 63 | echo "GIT_VERSION=$GIT_VERSION" >> $GITHUB_ENV |
68 | 64 | echo "GIT_STRIPPED_VERSION=$GIT_STRIPPED_VERSION" >> $GITHUB_ENV |
69 | 65 | shell: bash |
|
72 | 68 | id: release_notes |
73 | 69 | run: | |
74 | 70 | 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" |
75 | 72 | echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV |
76 | 73 | echo "$RELEASE_NOTES" >> $GITHUB_ENV |
77 | 74 | echo "EOF" >> $GITHUB_ENV |
|
0 commit comments