@@ -10,10 +10,14 @@ jobs:
1010 rid : ['win-x64', 'osx-x64', 'linux-x64']
1111 env :
1212 NUGET_URL : https://nuget.pkg.github.com/microsoft/index.json
13- PACKAGE_VERSION : unversioned
14- PACKAGE_TEMPLATE : msgraph-cli-{0}-{1}
13+ PACKAGE_VERSION : ${{github.ref_name || 'v0.1.0'}}
14+ PACKAGE_ZIP_TEMPLATE : " msgraph-cli-{0}-{1}.zip "
1515 OUTPUT_DIR : /tmp/publish
1616 steps :
17+ - id : get-version
18+ run : |
19+ PACKAGE_VERSION=$(echo $PACKAGE_VERSION | sed s/^v//)
20+ echo "::set-output name=version::$PACKAGE_VERSION"
1721 - name : Checkout
1822 uses : actions/checkout@v2
1923 with :
2226 uses : actions/setup-dotnet@v1
2327 with :
2428 dotnet-version : 6.x
25- - name : Set version
26- run : PACKAGE_VERSION=$(echo -e ${{github.ref_name}} | tr -d 'v')
2729 - name : Add NuGet kiota source
2830 # NOTE: Password encryption is not supported for the linux platform (Encryption is only supported on Windows platforms.)
2931 run : |
3941 run : dotnet publish --runtime ${{matrix.rid}} --self-contained true --configuration Release --output ${{env.OUTPUT_DIR}}
4042 - name : Package
4143 run : |
42- zip format('${{env.PACKAGE_TEMPLATE}}.zip', '${{matrix.rid}}', $PACKAGE_VERSION) ${{env.OUTPUT_DIR}}/*
44+ cd ${{env.OUTPUT_DIR}}
45+ zip ${{format(env.PACKAGE_ZIP_TEMPLATE, matrix.rid, steps.get-version.outputs.version)}} $(ls -a)
4346 - name : Add to release
44- run : gh release upload ${{github.ref_name}} format('${{env.PACKAGE_TEMPLATE}}.zip', '${{matrix.rid}}', $PACKAGE_VERSION) --clobber
47+ run : |
48+ gh release upload ${{github.ref_name}} ${{env.OUTPUT_DIR}}/${{format(env.PACKAGE_ZIP_TEMPLATE, matrix.rid, steps.get-version.outputs.version)}} --clobber
49+ env :
50+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments