Skip to content

Commit 2f803b5

Browse files
authored
feat(sage-monorepo): fix and update the release workflow to support mutiple products (#2875)
1 parent d572d4e commit 2f803b5

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

.github/workflows/release.yml

+10-6
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ name: release
33
on:
44
push:
55
tags:
6+
- 'agora/v*'
67
- 'openchallenges/v*'
78

89
env:
910
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
1011
DOCKER_USERNAME: ${{ github.actor }}
12+
PRODUCT: ''
1113
VERSION: ''
1214

1315
jobs:
@@ -19,13 +21,15 @@ jobs:
1921
with:
2022
fetch-depth: 1
2123

22-
- name: Extract version from Git tag
23-
id: extract_version
24+
- name: Extract product and version from Git tag
2425
run: |
25-
# Get the tag name and remove 'openchallenges/' prefix
26-
VERSION=${GITHUB_REF#refs/tags/openchallenges/v}
26+
# Extract the product name (part before the first slash) and version (part after the first slash)
27+
PRODUCT=$(echo "${GITHUB_REF#refs/tags/}" | cut -d'/' -f1)
28+
VERSION=$(echo "${GITHUB_REF#refs/tags/}" | cut -d'/' -f2)
29+
30+
# Output extracted values for the rest of the job
31+
echo "PRODUCT=${PRODUCT}" >> $GITHUB_ENV
2732
echo "VERSION=${VERSION}" >> $GITHUB_ENV
28-
echo "Docker image tag will be: ${VERSION}"
2933
3034
- name: Derive appropriate SHAs for base and head for `nx affected` commands
3135
uses: nrwl/nx-set-shas@v4
@@ -37,4 +41,4 @@ jobs:
3741
run: |
3842
devcontainer exec --workspace-folder ../sage-monorepo bash -c ". ./dev-env.sh \
3943
&& export VERSION=${{ env.VERSION }} \
40-
&& nx build-image openchallenges-apex --configuration=ci"
44+
&& nx build-image ${{ env.PRODUCT }}-apex --configuration=ci"

0 commit comments

Comments
 (0)