Skip to content

Commit fbf4c6f

Browse files
committed
fix artifact naming
1 parent 301e6e9 commit fbf4c6f

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

.github/workflows/go-build.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,33 @@ jobs:
7171
- name: run tests
7272
run: make test
7373

74+
publish-artifact-name:
75+
runs-on: ubuntu-latest
76+
77+
defaults:
78+
run:
79+
working-directory: ./${{ inputs.service }}
80+
81+
outputs:
82+
artifact_name: ${{ steps.artifact-name.outputs.name }}
83+
84+
steps:
85+
- name: checkout sources
86+
uses: actions/checkout@v4
87+
with:
88+
ref: ${{ inputs.sha }}
89+
90+
- name: get artifact name
91+
id: artifact-name
92+
run: echo "name=$(make getname VERSION=${{ inputs.artifactVersion }})" >> $GITHUB_OUTPUT
93+
7494
build:
7595
runs-on: ubuntu-latest
7696

7797
needs:
7898
- lint
7999
- test
100+
- publish-artifact-name
80101

81102
strategy:
82103
matrix:
@@ -109,22 +130,18 @@ jobs:
109130
- name: build
110131
run: make build VERSION="${{ inputs.artifactVersion }}"
111132

112-
- name: get artifact name
113-
if: matrix.upload
114-
id: artifact-name
115-
run: echo "name=$(make getname VERSION=${{ inputs.artifactVersion }})" >> $GITHUB_OUTPUT
116-
117133
- name: upload build artifact
118134
if: matrix.upload
119135
uses: actions/upload-artifact@v4
120136
with:
121-
name: ${{ steps.artifact-name.outputs.name }}
137+
name: ${{ needs.publish-artifact-name.outputs.artifact_name }}
122138
path: ${{ inputs.service}}/bin/${{ steps.artifact-name.outputs.name }}
123139
retention-days: 5
124140

125141
create-linux-packages:
126142
needs:
127143
- build
144+
- publish-artifact-name
128145

129146
runs-on: ubuntu-latest
130147

@@ -143,7 +160,7 @@ jobs:
143160
- name: download build artifact
144161
uses: actions/download-artifact@v4
145162
with:
146-
name: ${{ steps.artifact-name.outputs.name }}
163+
name: ${{ needs.publish-artifact-name.outputs.artifact_name }}
147164
path: ${{ inputs.service }}/bin
148165
merge-multiple: true
149166

0 commit comments

Comments
 (0)