Skip to content

Commit f342668

Browse files
committed
fix upload of artifacts not working (because they were dirs 🤦‍♂️)
1 parent 0c287b4 commit f342668

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
name: Release
22

3-
env:
4-
DIST_DIR: dist
5-
63
on:
74
push:
85
tags:
@@ -80,7 +77,7 @@ jobs:
8077
- name: upload artifacts
8178
uses: actions/upload-artifact@v2
8279
with:
83-
name: clang-${{ matrix.config.name }}-${{ matrix.config.arch }}
80+
name: clang_${{ matrix.config.name }}_${{ matrix.config.arch }}
8481
path: |
8582
${{ needs.get-version.outputs.llvm-version }}${{ matrix.config.bindir }}/clangd${{ matrix.config.extension }}
8683
${{ needs.get-version.outputs.llvm-version }}${{ matrix.config.bindir }}/clang-format${{ matrix.config.extension }}
@@ -146,28 +143,36 @@ jobs:
146143
- name: upload artifacts
147144
uses: actions/upload-artifact@v2
148145
with:
149-
name: clang-${{ matrix.config.name }}-${{ matrix.config.arch }}
146+
name: clang_${{ matrix.config.name }}_${{ matrix.config.arch }}
150147
path: |
151148
${{ needs.get-version.outputs.llvm-version }}/build/bin/clangd*
152149
${{ needs.get-version.outputs.llvm-version }}/build/bin/clang-format*
153150
154151
create-release:
155152
runs-on: ubuntu-latest
156-
needs:
157-
- build-linux
158-
- build-win-mac
153+
needs: [build-linux, build-win-mac, get-version]
159154

160155
steps:
161156
- name: Download artifact
162157
uses: actions/download-artifact@v2
163-
with:
164-
path: ${{ env.DIST_DIR }}
158+
159+
- name: Prepare artifacts for the release
160+
run: |
161+
mkdir release
162+
declare -a target_folders=("linux_amd64" "linux_386" "linux_arm64" "linux_arm" "darwin_amd64" "windows_386" "windows_amd64")
163+
for folder in "${target_folders[@]}"
164+
do
165+
chmod -v +x clang_$folder/*
166+
FILENAME=clang-${{ needs.get-version.outputs.tag }}-${folder}.tar.bz2
167+
tar -cvjf $FILENAME clang_$folder/
168+
done
169+
mv -v clang*.tar.bz2 release/
165170
166171
- name: Create Github Release and upload artifacts
167172
uses: ncipollo/release-action@v1
168173
with:
169174
token: ${{ secrets.GITHUB_TOKEN }}
170175
draft: false
171176
# NOTE: "Artifact is a directory" warnings are expected and don't indicate a problem
172-
# (all the files we need are in the DIST_DIR root)
173-
artifacts: ${{ env.DIST_DIR }}/*
177+
# (all the files we need are in the release folder root)
178+
artifacts: release/*

0 commit comments

Comments
 (0)