Skip to content

Commit 3661177

Browse files
committed
ci: fix archiving
1 parent a7efedf commit 3661177

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

.github/workflows/publish.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,14 @@ jobs:
2626
- name: Install .NET dependencies
2727
run: dotnet restore
2828

29+
- name: Extract version from tag
30+
run: |
31+
# Extract the version from the tag (e.g., 'refs/tags/v1.2.3' -> '1.2.3')
32+
VERSION=${GITHUB_REF#refs/tags/v}
33+
echo "VERSION=$VERSION" >> $GITHUB_ENV
34+
2935
- name: Publish for ${{ matrix.runtime }}
30-
run: dotnet publish -c Release -r ${{ matrix.runtime }} --no-restore
36+
run: dotnet publish -c Release -r ${{ matrix.runtime }} -p:Version=${{ env.VERSION }} -p:FileVersion=${{ env.VERSION }} -p:AssemblyName=CrossLaunch-${{ env.VERSION }} --no-restore
3137

3238
- name: Test
3339
run: dotnet test -c Release --no-restore --no-build --verbosity normal --logger "trx;LogFileName=test-results.trx" --results-directory dist/tests --collect:"XPlat Code Coverage"
@@ -49,12 +55,6 @@ jobs:
4955
- name: Lint
5056
run: dotnet csharpier --check .
5157

52-
- name: Extract version from tag
53-
run: |
54-
# Extract the version from the tag (e.g., 'refs/tags/v1.2.3' -> '1.2.3')
55-
VERSION=${GITHUB_REF#refs/tags/v}
56-
echo "VERSION=$VERSION" >> $GITHUB_ENV
57-
5858
- name: Archive ${{ matrix.runtime }} artifacts
5959
shell: bash
6060
run: |
@@ -63,10 +63,10 @@ jobs:
6363
6464
if [[ "${{ matrix.runtime }}" == win-* ]]; then
6565
OUTPUT_FILE="CrossLaunch-${{ env.VERSION }}-${{ matrix.runtime }}.zip"
66-
zip -r $OUTPUT_FILE $PUBLISH_DIR
66+
zip -rj $OUTPUT_FILE $PUBLISH_DIR
6767
else
6868
OUTPUT_FILE="CrossLaunch-${{ env.VERSION }}-${{ matrix.runtime }}.tar.gz"
69-
tar -czvf $OUTPUT_FILE -C $PUBLISH_DIR
69+
tar -czvf $OUTPUT_FILE -C $PUBLISH_DIR .
7070
fi
7171
7272
echo "ARCHIVE_PATH=$(realpath $OUTPUT_FILE)" >> $GITHUB_ENV

0 commit comments

Comments
 (0)