Skip to content

Commit 1ae633f

Browse files
Merge pull request #11 from SolaceLabs/ci_imporvements
Include web_visualizer into build wheel
2 parents 79679ac + 1936fc5 commit 1ae633f

File tree

3 files changed

+41
-15
lines changed

3 files changed

+41
-15
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
pip install virtualenv
7474
7575
- name: Run Whitesource Scan
76-
if: ${{ github.repository_owner == 'SolaceLabs' && github.ref == 'refs/heads/main' }}
76+
if: ${{ github.ref == 'refs/heads/main' }}
7777
uses: SolaceDev/solace-public-workflows/.github/actions/whitesource-scan@main
7878
with:
7979
whitesource_product_name: ${{ env.WS_PRODUCT_NAME}}
@@ -82,7 +82,7 @@ jobs:
8282
whitesource_config_file: wss-unified-agent.config
8383

8484
- name: Run WhiteSource Policy Gate
85-
if: ${{ github.repository_owner == 'SolaceLabs' && github.ref == 'refs/heads/main' }}
85+
if: ${{ github.ref == 'refs/heads/main' }}
8686
uses: docker://ghcr.io/solacedev/maas-build-actions:latest
8787
env:
8888
WS_API_KEY: ${{ secrets.WHITESOURCE_API_KEY }}
@@ -102,7 +102,7 @@ jobs:
102102
"
103103
104104
- name: Run WhiteSource Vulnerability Gate
105-
if: ${{ github.repository_owner == 'SolaceLabs' && github.ref == 'refs/heads/main' }}
105+
if: ${{ github.ref == 'refs/heads/main' }}
106106
uses: docker://ghcr.io/solacedev/maas-build-actions:latest
107107
continue-on-error: true
108108
env:

.github/workflows/release.yml

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,54 @@ jobs:
4747
uses: SolaceDev/solace-public-workflows/.github/actions/hatch-setup@main
4848

4949
- name: Get Current Version
50+
id: current_version
5051
run: |
5152
CURRENT_VERSION=$(hatch version)
5253
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
5354
54-
- name: Fail if the current version doesn't exist
55-
if: env.CURRENT_VERSION == ''
56-
run: exit 1
55+
- name: Check if last commit was a version bump commit
56+
id: check_bump
57+
run: |
58+
LAST_COMMIT_MSG=$(git log -1 --pretty=%B)
59+
echo "Last commit: $LAST_COMMIT_MSG"
60+
if echo "$LAST_COMMIT_MSG" | grep -q "\[ci skip\] Bump version to"; then
61+
echo "Previous commit was a version bump. Skipping version bump."
62+
echo "SKIP_BUMP=1" >> $GITHUB_ENV
63+
else
64+
echo "SKIP_BUMP=0" >> $GITHUB_ENV
65+
fi
5766
5867
- name: Bump Version
68+
id: bump_version
5969
run: |
60-
hatch version "${{ github.event.inputs.version }}"
61-
NEW_VERSION=$(hatch version)
62-
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV
70+
if [ "$SKIP_BUMP" = "1" ]; then
71+
echo "Skipping version bump as the last commit was a version bump."
72+
echo "NEW_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
73+
else
74+
if [ -n "${{ github.event.inputs.full_version }}" ]; then
75+
if [[ "${{ github.event.inputs.full_version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
76+
hatch version "${{ github.event.inputs.full_version }}"
77+
else
78+
echo "Invalid full_version provided: ${{ github.event.inputs.full_version }}. Expected format x.y.z."
79+
exit 1
80+
fi
81+
else
82+
hatch version "${{ github.event.inputs.version }}"
83+
fi
84+
NEW_VERSION=$(hatch version)
85+
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV
86+
fi
87+
88+
- name: Fail if the current version doesn't exist
89+
if: env.CURRENT_VERSION == ''
90+
run: exit 1
6391

6492
- name: Commit new version
93+
if: ${{ env.SKIP_BUMP == '0' }}
6594
run: |
6695
git config --local user.email "action@github.com"
6796
git config --local user.name "GitHub Action"
68-
git commit -a -m "[ci skip] Bump version to $NEW_VERSION"
97+
git commit -a -m "[ci skip] Bump version to ${NEW_VERSION}"
6998
git push
7099
71100
- name: Build project for distribution

pyproject.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,21 @@ homepage = "https://github.com/SolaceLabs/solace-agent-mesh"
6767
repository = "https://github.com/SolaceLabs/solace-agent-mesh"
6868
documentation = "https://github.com/SolaceLabs/solace-agent-mesh/blob/main/docs/docs/index.md"
6969

70-
[tool.hatch.metadata]
71-
allow-direct-references = true
72-
7370
[tool.hatch.build.targets.wheel.force-include]
7471
"src" = "solace_agent_mesh/"
7572
"configs" = "solace_agent_mesh/configs"
7673
"templates" = "solace_agent_mesh/templates"
7774
"cli" = "solace_agent_mesh/cli"
75+
"web-visualizer/dist" = "solace_agent_mesh/assets/web-visualizer"
7876

7977
[tool.hatch.build.targets.sdist.force-include]
80-
"web-visualizer/dist" = "solace_agent_mesh/assets/web-visualizer"
78+
"web-visualizer/dist" = "/assets/web-visualizer"
8179

8280
[project.scripts]
8381
solace-agent-mesh = "solace_agent_mesh.cli.main:main"
8482
sam = "solace_agent_mesh.cli.main:main"
8583

8684
[tool.hatch.build.targets.wheel]
87-
require-runtime-dependencies = true
8885
packages = ["solace_agent_mesh"]
8986

9087

0 commit comments

Comments
 (0)