Skip to content

Commit 7f30203

Browse files
committed
ci: create sep. zip file for usage via draft job
1 parent 327ae18 commit 7f30203

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/draft.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,19 @@ jobs:
4949
shell: bash
5050
run: |
5151
export ARTIFACT_NAME="${{ env.PROJECT_NAME }}-${{ matrix.target }}-${{ github.ref_name }}"
52+
export DRAFT_DIR="${ARTIFACT_NAME}"
5253
cargo build --release --locked --target "${{ matrix.target }}"
5354
mkdir -p "${ARTIFACT_NAME}"
5455
cp "target/${{ matrix.target }}/release/${{ env.PROJECT_NAME }}" "${ARTIFACT_NAME}"
5556
cp "README.md" "LICENSE-MIT" "LICENSE-APACHE" "${ARTIFACT_NAME}"
57+
cd "${ARTIFACT_NAME}"
58+
zip -r "../${ARTIFACT_NAME}.zip" .
59+
cd ..
5660
- name: "Upload artifact"
5761
uses: actions/upload-artifact@v4
5862
with:
5963
name: ${{ env.PROJECT_NAME }}-${{ matrix.target }}-${{ github.ref_name }}.zip
60-
path: ${{ env.PROJECT_NAME }}-${{ matrix.target }}-${{ github.ref_name }}.zip
64+
path: ${{ env.PROJECT_NAME }}-${{ matrix.target }}-${{ github.ref_name }} # We don't want the zipped archive as upload-artifact already zips it
6165
if-no-files-found: 'error'
6266
compression-level: '9'
6367
# overwrite: 'true'
@@ -91,14 +95,16 @@ jobs:
9195
shell: powershell
9296
run: |
9397
$ARTIFACT_NAME="${{ env.PROJECT_NAME }}-${{ matrix.target }}-${{ github.ref_name }}"
98+
$DRAFT_DIR="${ARTIFACT_NAME}"
9499
New-Item -ItemType Directory -Path "$ARTIFACT_NAME"
95100
Copy-Item -Path "target\${{ matrix.target }}\release\${{ env.PROJECT_NAME }}.exe" -Destination "$ARTIFACT_NAME"
96101
Copy-Item -Path "README.md", "LICENSE-APACHE", "LICENSE-MIT" -Destination "$ARTIFACT_NAME"
102+
Compress-Archive -Path "$ARTIFACT_NAME\*" -Destination "$ARTIFACT_NAME.zip"
97103
- name: "Upload artifact"
98104
uses: actions/upload-artifact@v4
99105
with:
100106
name: ${{ env.PROJECT_NAME }}-${{ matrix.target }}-${{ github.ref_name }}.zip
101-
path: ${{ env.PROJECT_NAME }}-${{ matrix.target }}-${{ github.ref_name }}.zip
107+
path: ${{ env.PROJECT_NAME }}-${{ matrix.target }}-${{ github.ref_name }} # We don't want the zipped archive as upload-artifact already zips it
102108
if-no-files-found: 'error'
103109
compression-level: '9'
104110
# overwrite: 'true'
@@ -126,7 +132,7 @@ jobs:
126132
draft: true
127133
# make_latest: true ## Drafts & prereleases cannot be set as `make_latest:`
128134
files: |
129-
${{ steps.artifact-download-step.outputs.download-path }}
135+
${{ env.PROJECT_NAME }}-*.zip
130136
generate_release_notes: true
131137
# body_path: ${{ github.workspace }}-CHANGELOG.txt ## For adding changelog content
132138

0 commit comments

Comments
 (0)