Skip to content

Commit da27900

Browse files
authored
Merge pull request #25 from layer5io/ci/workflow/updates
[CI] Refactor workflows. Only push on release
2 parents 5ca7a47 + bf371b0 commit da27900

File tree

3 files changed

+90
-8
lines changed

3 files changed

+90
-8
lines changed

.github/workflows/build.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Docker Extension for Kanvas
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
branches:
8+
- "master"
9+
paths-ignore:
10+
- "docs/**"
11+
# - '.github/**'
12+
13+
workflow_dispatch:
14+
inputs:
15+
release-ver:
16+
description: "Stable Release Version"
17+
required: true
18+
default: "v"
19+
stripped-release-ver:
20+
description: "Stripped Stable Release Version"
21+
required: true
22+
default: ""
23+
release-channel:
24+
description: "Release Channel"
25+
required: true
26+
default: "edge"
27+
28+
env:
29+
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}}
32+
33+
jobs:
34+
derive-version-info:
35+
runs-on: ubuntu-24.04
36+
outputs:
37+
GIT_VERSION: ${{ steps.set-vars.outputs.GIT_VERSION }}
38+
GIT_STRIPPED_VERSION: ${{ steps.set-vars.outputs.GIT_STRIPPED_VERSION }}
39+
RELEASE_CHANNEL: ${{ steps.set-vars.outputs.RELEASE_CHANNEL }}
40+
steps:
41+
- name: Set version variables from tag
42+
id: set-vars
43+
run: |
44+
TAG_NAME="${{ github.event.release.tag_name }}"
45+
echo "Detected tag: $TAG_NAME"
46+
47+
# Strip 'v' from version tag if it exists
48+
STRIPPED_VERSION="${TAG_NAME#v}"
49+
50+
# Use 'stable' if it's a tagged release, else fallback to 'edge'
51+
if [[ "$TAG_NAME" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
52+
CHANNEL="stable"
53+
else
54+
CHANNEL="edge"
55+
fi
56+
57+
echo "GIT_VERSION=$TAG_NAME" >> $GITHUB_OUTPUT
58+
echo "GIT_STRIPPED_VERSION=$STRIPPED_VERSION" >> $GITHUB_OUTPUT
59+
echo "RELEASE_CHANNEL=$CHANNEL" >> $GITHUB_OUTPUT
60+
61+
docker-extension:
62+
needs: derive-version-info
63+
runs-on: ubuntu-24.04
64+
env:
65+
GIT_VERSION: ${{ needs.derive-version-info.outputs.GIT_VERSION }}
66+
GIT_STRIPPED_VERSION: ${{ needs.derive-version-info.outputs.GIT_STRIPPED_VERSION }}
67+
RELEASE_CHANNEL: ${{ needs.derive-version-info.outputs.RELEASE_CHANNEL }}
68+
steps:
69+
- name: Checkout 🛎️ repo
70+
uses: actions/checkout@v4
71+
72+
- name: Build Extension UI
73+
run: |
74+
# Build UI. Produce local package.
75+
make ui-build
76+
77+
- name: Build Extension
78+
run: |
79+
# Build service image to be deployed as a Docker extension
80+
make extension-build
81+
82+

.github/workflows/multi-platform.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ name: Multi-Platform Build and Release
22
on:
33
release:
44
types: [published]
5-
push:
6-
tags:
7-
- "v*"
8-
branches:
9-
- "master"
10-
paths-ignore:
11-
- "docs/**"
5+
# push:
6+
# tags:
7+
# - "v*"
8+
# branches:
9+
# - "master"
10+
# paths-ignore:
11+
# - "docs/**"
1212
# - '.github/**'
1313
workflow_dispatch:
1414
inputs:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ bin:
2626
$(GO_BUILD) -o bin/service ./vm
2727

2828
## Build service image to be deployed as a Docker extension
29-
extension:
29+
extension-build:
3030
docker build --tag=$(IMAGE) --build-arg GIT_VERSION=$(GIT_VERSION) --build-arg GIT_STRIPPED_VERSION=$(GIT_STRIPPED_VERSION) .
3131

3232
## Build extension container with no cache

0 commit comments

Comments
 (0)