diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index f9f6386..687d3c1 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -113,10 +113,16 @@ jobs: run: | rm -f ${HOME}/.docker/config.json + - name: Prepare + if: success() && startsWith(github.ref, 'refs/tags') + id: zipname + run: | + echo ::set-output name=zip_name::aliyun-ddns-${GITHUB_REF#refs/tags/}.zip + echo ::set-output name=version::${GITHUB_REF#refs/tags/} - name: Create zip if: success() && startsWith(github.ref, 'refs/tags') run: | - zip -q -r aliyun-ddns-${GITHUB_REF#refs/tags/}.zip ./.github/out/* + zip -q -r ${{ steps.zipname.outputs.zip_name }} ./.github/out/* - name: Create Release if: success() && startsWith(github.ref, 'refs/tags') @@ -125,8 +131,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${GITHUB_REF#refs/tags/} - release_name: Release ${GITHUB_REF#refs/tags/} + tag_name: ${{ steps.zipname.outputs.version }} + release_name: ${{ steps.zipname.outputs.version }} draft: false prerelease: false - name: Upload Release Asset @@ -137,6 +143,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./aliyun-ddns-${GITHUB_REF#refs/tags/}.zip - asset_name: aliyun-ddns-${GITHUB_REF#refs/tags/}.zip + asset_path: ./${{ steps.zipname.outputs.zip_name }} + asset_name: ${{ steps.zipname.outputs.zip_name }} asset_content_type: application/zip