Skip to content

Commit cd99939

Browse files
committed
fix(ci): fix publish version
1 parent 30794ff commit cd99939

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

.github/workflows/deploy.yml

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ jobs:
3737
key: ${{ github.ref }}-${{ github.run_id }}-build
3838

3939
- name: Checkout branch ${{ github.ref }}
40-
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
4140
uses: actions/checkout@v3
4241

4342
- name: Build

.github/workflows/publish.yml

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ name: Publish - npm Publish and Github Release
66
on:
77
workflow_call:
88
inputs:
9+
commit-hash:
10+
description: Commit to checkout
11+
required: false
12+
type: string
913
tag-name:
1014
description: Tag name
1115
required: false
@@ -63,6 +67,7 @@ jobs:
6367
- name: Checkout branch ${{ github.ref }}
6468
uses: actions/checkout@v3
6569
with:
70+
ref: ${{ inputs.commit-hash || 'main' }}
6671
fetch-depth: 0
6772

6873
- name: Build

.github/workflows/release.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030

3131
outputs:
3232
tag-name: ${{ steps.push-tag.outputs.tag_name }}
33+
commit-hash: ${{ steps.push-tag.outputs.commit_hash }}
3334

3435
steps:
3536
- name: Checkout branch ${{ github.ref }}
@@ -80,15 +81,21 @@ jobs:
8081
git push origin --follow-tags
8182
8283
tag_name=$(git describe --abbrev=0 --match 'v*')
84+
commit_hash=$(git rev-parse HEAD)
8385
84-
echo "tag_name=$tag_name" >> "$GITHUB_OUTPUT"
86+
echo "Pushing tag: ${tag_name}"
87+
echo "Pushing commit: ${commit_hash}"
88+
89+
echo "tag_name=${tag_name}" >> "$GITHUB_OUTPUT"
90+
echo "commit_hash=${commit_hash}" >> "$GITHUB_OUTPUT"
8591
8692
publish:
8793
name: Publish
8894
needs: release
8995
uses: ./.github/workflows/publish.yml
9096
secrets: inherit
9197
with:
98+
commit-hash: ${{ needs.release.outputs.commit-hash }}
9299
tag-name: ${{ inputs.tag-name || needs.release.outputs.tag-name }}
93100
skip-npm: ${{ inputs.skip-npm }}
94101

0 commit comments

Comments
 (0)