Skip to content

Commit 396de0a

Browse files
committed
ci: update cd
1 parent 3b53807 commit 396de0a

File tree

1 file changed

+21
-44
lines changed

1 file changed

+21
-44
lines changed

.github/workflows/cd.yml

Lines changed: 21 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -14,50 +14,27 @@ jobs:
1414
# ====================================================
1515
# Versioning and Release
1616
# ====================================================
17-
versioning:
18-
name: versioning
19-
runs-on: ubuntu-latest
20-
outputs:
21-
new_release_version: ${{ steps.set-outputs.outputs.version }}
22-
new_release_published: ${{ steps.set-outputs.outputs.published }}
23-
steps:
24-
- name: Checkout
25-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
26-
with:
27-
fetch-depth: 0
28-
29-
- name: Check existing release
30-
id: check-release
31-
run: |
32-
CURRENT_SHA=$(git rev-parse HEAD)
33-
EXISTING_TAG=$(git tag --points-at $CURRENT_SHA | grep '^v' | head -1)
34-
if [ -n "$EXISTING_TAG" ]; then
35-
echo "existing_tag=$EXISTING_TAG" >> $GITHUB_OUTPUT
36-
echo "existing_version=${EXISTING_TAG#v}" >> $GITHUB_OUTPUT
37-
echo "has_existing=true" >> $GITHUB_OUTPUT
38-
else
39-
echo "has_existing=false" >> $GITHUB_OUTPUT
40-
fi
41-
42-
- id: release
43-
name: Release
44-
if: steps.check-release.outputs.has_existing == 'false'
45-
uses: cycjimmy/semantic-release-action@b12c8f6015dc215fe37bc154d4ad456dd3833c90 # v6.0.0
46-
env:
47-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48-
49-
- name: Set outputs
50-
id: set-outputs
51-
run: |
52-
if [ "${{ steps.check-release.outputs.has_existing }}" == "true" ]; then
53-
echo "version=${{ steps.check-release.outputs.existing_version }}" >> $GITHUB_OUTPUT
54-
echo "published=true" >> $GITHUB_OUTPUT
55-
echo "Using existing release: ${{ steps.check-release.outputs.existing_version }}"
56-
else
57-
echo "version=${{ steps.release.outputs.new_release_version }}" >> $GITHUB_OUTPUT
58-
echo "published=${{ steps.release.outputs.new_release_published }}" >> $GITHUB_OUTPUT
59-
echo "New release: ${{ steps.release.outputs.new_release_version }}"
60-
fi
17+
semantic-release:
18+
name: semantic-release
19+
uses: ./.github/workflows/shared-semantic-release.yml
20+
with:
21+
allowed_workflow_dispatch_branches: '["main"]'
22+
fail_on_invalid_workflow_dispatch_ref: true
23+
24+
zerv-versioning:
25+
needs: semantic-release
26+
if: needs.semantic-release.outputs.is_valid_semantic_release == 'true'
27+
uses: ./.github/workflows/shared-zerv-versioning.yml
28+
29+
create-version-prefix-tags:
30+
needs: zerv-versioning
31+
uses: ./.github/workflows/shared-create-tags.yml
32+
with:
33+
tags: >-
34+
[
35+
"${{ fromJson(needs.zerv-versioning.outputs.versions).v_semver_major }}",
36+
"${{ fromJson(needs.zerv-versioning.outputs.versions).v_semver_major_minor }}"
37+
]
6138
6239
# ====================================================
6340
# Test and Lint

0 commit comments

Comments
 (0)