Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sage-monorepo): fix and update the release workflow to support mutiple products #2875

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ name: release
on:
push:
tags:
- 'agora/v*'
- 'openchallenges/v*'

env:
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ github.actor }}
PRODUCT: ''
VERSION: ''

jobs:
Expand All @@ -19,13 +21,15 @@ jobs:
with:
fetch-depth: 1

- name: Extract version from Git tag
id: extract_version
- name: Extract product and version from Git tag
run: |
# Get the tag name and remove 'openchallenges/' prefix
VERSION=${GITHUB_REF#refs/tags/openchallenges/v}
# Extract the product name (part before the first slash) and version (part after the first slash)
PRODUCT=$(echo "${GITHUB_REF#refs/tags/}" | cut -d'/' -f1)
VERSION=$(echo "${GITHUB_REF#refs/tags/}" | cut -d'/' -f2)

# Output extracted values for the rest of the job
echo "PRODUCT=${PRODUCT}" >> $GITHUB_ENV
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "Docker image tag will be: ${VERSION}"

- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v4
Expand All @@ -37,4 +41,4 @@ jobs:
run: |
devcontainer exec --workspace-folder ../sage-monorepo bash -c ". ./dev-env.sh \
&& export VERSION=${{ env.VERSION }} \
&& nx build-image openchallenges-apex --configuration=ci"
&& nx build-image ${{ env.PRODUCT }}-apex --configuration=ci"
Loading