Skip to content

Commit 265f949

Browse files
authored
chore: improve release-please workflow (#59)
- Skip if version already released - Use tag format vX.Y.Z (exclude package name)
1 parent 3fbc168 commit 265f949

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

.github/release-please-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
".": {
55
"release-type": "python",
66
"package-name": "google-adk-community",
7+
"include-component-in-tag": false,
78
"draft": true,
89
"changelog-path": "CHANGELOG.md",
910
"changelog-sections": [

.github/workflows/release-please.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,27 @@ jobs:
3737
with:
3838
ref: ${{ steps.vars.outputs.branch }}
3939

40+
- name: Check if version already released
41+
id: check
42+
run: |
43+
TARGET="${{ steps.vars.outputs.version }}"
44+
CURRENT=$(jq -r '."."' .github/.release-please-manifest.json)
45+
if [ "$CURRENT" == "$TARGET" ]; then
46+
echo "Version $TARGET already released, skipping"
47+
echo "skip=true" >> $GITHUB_OUTPUT
48+
else
49+
echo "skip=false" >> $GITHUB_OUTPUT
50+
fi
51+
4052
- name: Set release-as version
53+
if: steps.check.outputs.skip != 'true'
4154
run: |
4255
jq --arg version "${{ steps.vars.outputs.version }}" \
4356
'.packages["."]["release-as"] = $version' \
4457
.github/release-please-config.json > tmp.json && mv tmp.json .github/release-please-config.json
4558
4659
- uses: googleapis/release-please-action@v4
60+
if: steps.check.outputs.skip != 'true'
4761
id: release
4862
with:
4963
token: ${{ secrets.RELEASE_PAT }}

0 commit comments

Comments
 (0)