Skip to content

Commit 8afeae9

Browse files
fix filename (#42)
Co-authored-by: CommonLoon102 <CommonLoon102@users.noreply.github.com>
1 parent d331a69 commit 8afeae9

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,17 @@ jobs:
6060
- name: Publish
6161
run: dotnet publish ${{ env.app_name }}/${{ env.app_name }}.${{ matrix.config.project }}/${{ env.app_name }}.${{ matrix.config.project }}.csproj --configuration Release --output ${{ env.publish_folder }} --self-contained true -p:PublishSingleFile=${{ matrix.config.is_single_file }} --runtime ${{ matrix.config.runtime }} --framework ${{ matrix.config.framework }}
6262

63-
- name: Get the version
64-
id: get_version
63+
- name: Get the tag name
64+
id: get_tag_name
6565
if: (github.event_name == 'release' && github.event.action == 'published' && startsWith(github.ref, 'refs/tags/'))
66-
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
66+
shell: bash
67+
run: echo "::set-output name=TAG_NAME::$(git describe --tags --abbrev=0)"
6768

6869
- name: Create Package
6970
if: (github.event_name == 'release' && github.event.action == 'published' && startsWith(github.ref, 'refs/tags/'))
7071
shell: bash
7172
run: |
72-
filename=${{ env.app_name }}-${{ steps.get_version.outputs.VERSION }}-${{ matrix.config.runtime }}
73+
filename=${{ env.app_name }}-${{ steps.get_tag_name.outputs.TAG_NAME }}-${{ matrix.config.runtime }}
7374
if [[ "${{ runner.os }}" == 'Windows' ]]; then
7475
7z a $filename.zip ./${{ env.publish_folder }}/*
7576
else
@@ -80,7 +81,7 @@ jobs:
8081
if: (github.event_name == 'release' && github.event.action == 'published' && startsWith(github.ref, 'refs/tags/'))
8182
with:
8283
name: ${{ matrix.config.runtime }} Release
83-
path: ${{ env.app_name }}-${{ steps.get_version.outputs.VERSION }}-${{ matrix.config.runtime }}.zip
84+
path: ${{ env.app_name }}-${{ steps.get_tag_name.outputs.TAG_NAME }}-${{ matrix.config.runtime }}.zip
8485

8586
- uses: actions/upload-artifact@v2
8687
if: (github.event_name == 'push' || github.event_name == 'pull_request')
@@ -113,9 +114,11 @@ jobs:
113114
runtime: osx-x64
114115
}
115116
steps:
116-
- name: Get the version
117-
id: get_version
118-
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
117+
- name: Get the tag name
118+
id: get_tag_name
119+
if: (github.event_name == 'release' && github.event.action == 'published' && startsWith(github.ref, 'refs/tags/'))
120+
shell: bash
121+
run: echo "::set-output name=TAG_NAME::$(git describe --tags --abbrev=0)"
119122

120123
- name: Get release
121124
id: get_release
@@ -134,6 +137,6 @@ jobs:
134137
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
135138
with:
136139
upload_url: ${{ steps.get_release.outputs.upload_url }}
137-
asset_path: ${{ env.app_name }}-${{ steps.get_version.outputs.VERSION }}-${{ matrix.config.runtime }}.zip
138-
asset_name: ${{ env.app_name }}-${{ steps.get_version.outputs.VERSION }}-${{ matrix.config.runtime }}.zip
140+
asset_path: ${{ env.app_name }}-${{ steps.get_tag_name.outputs.TAG_NAME }}-${{ matrix.config.runtime }}.zip
141+
asset_name: ${{ env.app_name }}-${{ steps.get_tag_name.outputs.TAG_NAME }}-${{ matrix.config.runtime }}.zip
139142
asset_content_type: application/zip

0 commit comments

Comments
 (0)