Skip to content

Commit 341fd79

Browse files
committed
feat: simplify release workflow and unify archive format
1 parent 3a92a14 commit 341fd79

1 file changed

Lines changed: 9 additions & 23 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -158,19 +158,15 @@ jobs:
158158
- name: linux-x64
159159
runner: ubuntu-latest
160160
rid: linux-x64
161-
archive_ext: tar.gz
162161
- name: linux-arm64
163162
runner: ubuntu-latest
164163
rid: linux-arm64
165-
archive_ext: tar.gz
166164
- name: win-x64
167165
runner: windows-latest
168166
rid: win-x64
169-
archive_ext: zip
170167
- name: osx-arm64
171168
runner: macos-latest
172169
rid: osx-arm64
173-
archive_ext: tar.gz
174170
project:
175171
- name: OpenProfileServer
176172
project_file: ${{ env.SERVER_PROJECT }}
@@ -198,13 +194,12 @@ jobs:
198194
shell: bash
199195
run: |
200196
OUTPUT_DIR="./publish/${{ matrix.platform.name }}/${{ matrix.project.name }}"
201-
ARCHIVE_NAME="${{ matrix.project.output_name }}-${{ matrix.platform.name }}.${{ matrix.platform.archive_ext }}"
197+
ARCHIVE_NAME="${{ matrix.project.output_name }}-${{ matrix.platform.rid }}.tar.gz"
198+
199+
SINGLE_FILE_ARGS="-p:PublishSingleFile=true -p:IncludeAllContentForSelfExtract=true"
202200
203-
# Determine publish arguments based on platform
204201
if [[ "${{ matrix.platform.rid }}" == win-* ]]; then
205-
PUBLISH_ARGS="-p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true"
206-
else
207-
PUBLISH_ARGS="--nologo"
202+
SINGLE_FILE_ARGS="$SINGLE_FILE_ARGS -p:IncludeNativeLibrariesForSelfExtract=true"
208203
fi
209204
210205
# Build self-contained single file
@@ -215,19 +210,11 @@ jobs:
215210
--output "$OUTPUT_DIR" \
216211
-p:PublishTrimmed=false \
217212
-p:PublishReadyToRun=true \
218-
-p:IncludeAllContentForSelfExtract=true \
219-
$PUBLISH_ARGS
213+
$SINGLE_FILE_ARGS
220214
221-
# Create archive
222215
mkdir -p ./artifacts
223216
pushd "$OUTPUT_DIR" || exit 1
224-
225-
if [[ "${{ matrix.platform.archive_ext }}" == "zip" ]]; then
226-
7z a -tzip "../../artifacts/$ARCHIVE_NAME" *
227-
else
228-
tar -czf "../../artifacts/$ARCHIVE_NAME" *
229-
fi
230-
217+
tar -czf "../../artifacts/$ARCHIVE_NAME" *
231218
popd || exit 1
232219
233220
echo "Created archive: $ARCHIVE_NAME"
@@ -249,19 +236,18 @@ jobs:
249236
uses: actions/checkout@v4
250237
with:
251238
fetch-depth: 0
252-
ref: ${{ env.RELEASE_BRANCH }}
253239

254240
- name: Download all artifacts
255241
uses: actions/download-artifact@v4
256242
with:
257243
path: ./artifacts
258244

259-
- name: Create Release on release branch
245+
- name: Create Release
260246
uses: softprops/action-gh-release@v2
261247
with:
262248
tag_name: ${{ needs.prepare-release.outputs.tag }}
263249
name: ${{ needs.prepare-release.outputs.title }}
264-
target_commitish: ${{ env.RELEASE_BRANCH }}
250+
target_commitish: ${{ needs.prepare-release.outputs.commit_sha }}
265251
draft: ${{ needs.prepare-release.outputs.is_draft }}
266252
prerelease: ${{ needs.prepare-release.outputs.is_pre_release }}
267253
generate_release_notes: false
@@ -279,4 +265,4 @@ jobs:
279265
**Full Changelog**: https://github.com/${{ github.repository }}/commits/${{ needs.prepare-release.outputs.tag }}
280266
files: ./artifacts/*/*
281267
env:
282-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
268+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)