Skip to content

Commit 88d5ab2

Browse files
committed
Updating CI/CD workflows for version release
Signed-off-by: S3B4SZ17 <[email protected]>
1 parent d78dea1 commit 88d5ab2

File tree

2 files changed

+25
-49
lines changed

2 files changed

+25
-49
lines changed

.github/workflows/publish.yaml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -78,33 +78,20 @@ jobs:
7878
- name: Check out the repo
7979
uses: actions/checkout@v4
8080

81-
- name: Semantic Release
82-
uses: cycjimmy/semantic-release-action@v4
81+
- name: Get tag version
8382
id: semantic_release
84-
with:
85-
dry_run: true
86-
branches: |
87-
[
88-
'+([0-9])?(.{+([0-9]),x}).x',
89-
'main',
90-
{
91-
name: 'beta',
92-
prerelease: true
93-
},
94-
{
95-
name: 'alpha',
96-
prerelease: true
97-
},
98-
{
99-
name: 'feat-k8s-deploy',
100-
prerelease: true
101-
}
102-
]
83+
uses: anothrNick/[email protected]
10384
env:
10485
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
WITH_V: true
87+
DEFAULT_BUMP: "patch"
88+
TAG_CONTEXT: 'repo'
89+
PRERELEASE_SUFFIX: "beta"
90+
PRERELEASE: true
91+
DRY_RUN: true
10592

10693
- name: Summary
10794
run: |
10895
echo "## Release Summary
109-
- Tag: ${{ steps.semantic_release.outputs.new_release_version }}
96+
- Tag: ${{ steps.semantic_release.outputs.tag }}
11097
- Docker Image: ghcr.io/sysdiglabs/sysdig-mcp-server:v${{ steps.extract_version.outputs.VERSION }}" >> $GITHUB_STEP_SUMMARY

.github/workflows/test.yaml

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -45,52 +45,41 @@ jobs:
4545
steps:
4646
- name: Check out the repo
4747
uses: actions/checkout@v4
48+
with:
49+
ref: ${{ github.head_ref }} # checkout the correct branch name
50+
fetch-depth: 0
4851

4952
- name: Extract current version
5053
id: pyproject_version
5154
run: |
5255
TAG=v$(grep 'version =' pyproject.toml | sed -e 's/version = "\(.*\)"/\1/')
5356
echo "TAG=$TAG" >> "$GITHUB_OUTPUT"
5457
55-
- name: Semantic Release
56-
uses: cycjimmy/semantic-release-action@v4
58+
- name: Get tag version
5759
id: semantic_release
58-
with:
59-
ci: false
60-
dry_run: true
61-
branches: |
62-
[
63-
'+([0-9])?(.{+([0-9]),x}).x',
64-
'main',
65-
{
66-
name: 'beta',
67-
prerelease: true
68-
},
69-
{
70-
name: 'alpha',
71-
prerelease: true
72-
},
73-
{
74-
name: 'feat-k8s-deploy',
75-
prerelease: true
76-
}
77-
]
60+
uses: anothrNick/[email protected]
7861
env:
7962
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80-
63+
WITH_V: true
64+
DEFAULT_BUMP: "patch"
65+
TAG_CONTEXT: 'repo'
66+
PRERELEASE_SUFFIX: "beta"
67+
PRERELEASE: true
68+
DRY_RUN: true
69+
8170
- name: Compare versions
8271
run: |
8372
echo "Current version: ${{ steps.pyproject_version.outputs.TAG }}"
84-
echo "New version: ${{ steps.semantic_release.outputs.new_release_version }}"
85-
if [ "${{ steps.pyproject_version.outputs.TAG }}" != "${{ steps.semantic_release.outputs.new_release_version }}" ]; then
73+
echo "New version: ${{ steps.semantic_release.outputs.tag }}"
74+
if [ "${{ steps.pyproject_version.outputs.TAG }}" != "${{ steps.semantic_release.outputs.tag }}" ]; then
8675
echo "### Version mismatch detected! :warning:
8776
Current version: ${{ steps.pyproject_version.outputs.TAG }}
88-
New version: **${{ steps.semantic_release.outputs.new_release_version }}**
77+
New version: **${{ steps.semantic_release.outputs.tag }}**
8978
Please update the version in pyproject.toml." >> $GITHUB_STEP_SUMMARY
9079
exit 1
9180
else
9281
echo "### Version match confirmed! :rocket:
9382
Current version: ${{ steps.pyproject_version.outputs.TAG }}
94-
New version: **${{ steps.semantic_release.outputs.new_release_version }}**
83+
New version: **${{ steps.semantic_release.outputs.tag }}**
9584
The version is up-to-date." >> $GITHUB_STEP_SUMMARY
9685
fi

0 commit comments

Comments
 (0)