Skip to content

Commit a2dd318

Browse files
authored
Merge pull request #4 from bordeux/hotfix/fix-ci-cd
fix: fix ci/cd release process
2 parents ada715d + c3c512e commit a2dd318

1 file changed

Lines changed: 26 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,37 @@ jobs:
2929
with:
3030
node-version: '20'
3131

32-
- name: Install semantic-release
33-
run: |
34-
npm install -g semantic-release@23 \
35-
@semantic-release/git@10 \
36-
@semantic-release/changelog@6 \
37-
@semantic-release/exec@6 \
38-
conventional-changelog-conventionalcommits@7
32+
- name: Install dependencies
33+
run: npm ci
3934

4035
- name: Run semantic-release
4136
id: semantic
4237
env:
4338
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
run: npx semantic-release
39+
run: |
40+
# Get current tags
41+
BEFORE_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "none")
42+
43+
# Run semantic-release
44+
npx semantic-release 2>&1 | tee release-output.log
45+
46+
# Check if a new tag was created
47+
AFTER_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "none")
48+
49+
if [ "$BEFORE_TAG" != "$AFTER_TAG" ] && [ "$AFTER_TAG" != "none" ]; then
50+
echo "new_release_published=true" >> $GITHUB_OUTPUT
51+
VERSION=$(echo "$AFTER_TAG" | sed 's/^v//')
52+
echo "new_release_version=$VERSION" >> $GITHUB_OUTPUT
53+
echo "✅ Release published: $VERSION"
54+
else
55+
echo "new_release_published=false" >> $GITHUB_OUTPUT
56+
echo "ℹ️ No release published"
57+
fi
58+
59+
- name: Output release info
60+
run: |
61+
echo "New release published: ${{ steps.semantic.outputs.new_release_published }}"
62+
echo "New release version: ${{ steps.semantic.outputs.new_release_version }}"
4563
4664
build:
4765
name: Build ${{ matrix.target }}

0 commit comments

Comments
 (0)