Skip to content

Commit

Permalink
more options in set-version
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaiaeroastro committed Jan 22, 2025
1 parent 9e0694a commit 3c490c2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,31 @@ jobs:
runs-on: ubuntu-20.04
outputs:
lib3mf-version: ${{ steps.set-version.outputs.LIB3MF_VERSION }}
lib3mf-version-with-pre-release: ${{ steps.set-version.outputs.LIB3MF_VERSION_WITH_PRE_RELEASE }}
lib3mf-version-with-modified-pre-release: ${{ steps.set-version.outputs.LIB3MF_VERSION_WITH_MODIFIED_PRE_RELEASE }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Run version extraction script and set environment variable

- name: Run version extraction script and set environment variables
id: set-version
run: |
LIB3MF_VERSION=$(python CI/ci_cd_helper.py extract-version)
echo "LIB3MF_VERSION=$LIB3MF_VERSION" >> $GITHUB_OUTPUT
- name: Echo version for debug
run: echo "LIB3MF_VERSION=${{ steps.set-version.outputs.LIB3MF_VERSION }}"
VERSION_OUTPUT=$(python CI/ci_cd_helper.py extract-version)
CORE_VERSION=$(echo "$VERSION_OUTPUT" | jq -r '.core_version')
CORE_VERSION_WITH_PRE_RELEASE=$(echo "$VERSION_OUTPUT" | jq -r '.core_version_with_pre_release')
CORE_VERSION_WITH_MODIFIED_PRE_RELEASE=$(echo "$VERSION_OUTPUT" | jq -r '.core_version_with_modified_pre_release')
echo "LIB3MF_VERSION=$CORE_VERSION" >> $GITHUB_OUTPUT
echo "LIB3MF_VERSION_WITH_PRE_RELEASE=$CORE_VERSION_WITH_PRE_RELEASE" >> $GITHUB_OUTPUT
echo "LIB3MF_VERSION_WITH_MODIFIED_PRE_RELEASE=$CORE_VERSION_WITH_MODIFIED_PRE_RELEASE" >> $GITHUB_OUTPUT
- name: Echo versions for debug
run: |
echo "LIB3MF_VERSION=${{ steps.set-version.outputs.LIB3MF_VERSION }}"
echo "LIB3MF_VERSION_WITH_PRE_RELEASE=${{ steps.set-version.outputs.LIB3MF_VERSION_WITH_PRE_RELEASE }}"
echo "LIB3MF_VERSION_WITH_MODIFIED_PRE_RELEASE=${{ steps.set-version.outputs.LIB3MF_VERSION_WITH_MODIFIED_PRE_RELEASE }}"
build-linux-memtest:
runs-on: ubuntu-20.04
Expand Down
14 changes: 12 additions & 2 deletions CI/ci_cd_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,20 @@ def extract_version_from_cmake():
raise ValueError("Could not find version components in CMakeLists.txt")

version = f"{major.group(1)}.{minor.group(1)}.{micro.group(1)}"

core_version = version
core_version_with_pre_release = version
core_version_with_modified_pre_release = version
if prerelease and prerelease.group(1):
version += f".0"
core_version_with_pre_release += ".{0}".format(prerelease.group(1))
core_version_with_modified_pre_release += ".0"

return version
# Return all three values as a JSON object
return json.dumps({
"core_version": core_version,
"core_version_with_pre_release": core_version_with_pre_release,
"core_version_with_modified_pre_release": core_version_with_modified_pre_release
})

def get_integration_sdk_url(index):
url = "https://api.github.com/repos/3MFConsortium/test_suites/releases"
Expand Down

0 comments on commit 3c490c2

Please sign in to comment.