Skip to content

Commit 03a22f8

Browse files
authored
fix: update build.yml to fix publish (#55)
* fix: update build.yml to fix publish * fix: update build.yml * fix: remove upload condition * get release title and tag * move get-sha to the top of job * Update build.yml
1 parent 0bb7562 commit 03a22f8

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -183,38 +183,34 @@ jobs:
183183
cat clang-tidy-${{ env.suffix }}.sha512sum
184184
cat clang-apply-replacements-${{ env.suffix }}.sha512sum
185185
- name: Upload artifacts
186-
if: github.event_name != 'pull_request'
187186
uses: actions/upload-artifact@v4
188187
with:
189188
name: clang-tools-${{ matrix.release }}-${{ env.suffix }}
190189
path: "${{ matrix.release }}${{ matrix.bindir }}/clang-*-${{ env.suffix }}*"
191190
retention-days: 1
192191
draft-release:
193192
runs-on: ubuntu-22.04
194-
if: github.event_name != 'pull_request'
195193
needs: build
196194
steps:
197-
- name: Download artifacts
198-
uses: actions/download-artifact@v4
199-
with:
200-
path: clang-tools-artifacts
201-
merge-multiple: true
202-
- name: list files
203-
run: ls -laR clang-tools-artifacts
204-
- name: Delete all files over 2G # see issue 40
205-
run: find clang-tools-artifacts -type f -size +2G -exec rm -v {} \;
206195
- name: Checkout code
207196
uses: actions/checkout@v4
208197
- name: Get short SHA
209-
id: sha
198+
id: get-sha
210199
run: echo "short_sha=${GITHUB_SHA:0:8}" >> $GITHUB_OUTPUT
211-
- name: Create draft release and upload assets
200+
- name: Download artifacts
201+
uses: actions/download-artifact@v4
202+
- name: List files
203+
run: ls -laR .
204+
- name: Workaround - delete all files over 2G, above github release file upload limit
205+
run: find . -type f -size +2G -exec rm -v {} \;
206+
- name: Draft release
212207
env:
213208
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
214-
run: |
215-
RELEASE_TAG="master-${{ steps.sha.outputs.short_sha }}"
216-
gh release create "$RELEASE_TAG" \
217-
clang-tools-artifacts\* \
218-
--title "$RELEASE_TAG" \
219-
--notes "Draft release of prebuilt clang tools" \
220-
--draft
209+
uses: svenstaro/upload-release-action@v2
210+
with:
211+
repo_token: ${{ secrets.GITHUB_TOKEN }}
212+
release_name: master-${{ steps.get-sha.outputs.short_sha }}
213+
tag: master-${{ steps.get-sha.outputs.short_sha }}
214+
draft: true
215+
file_glob: true
216+
file: clang-*/**/*

0 commit comments

Comments
 (0)