Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit 5cc39d6

Browse files
authored
Merge pull request #31 from microsoftgraph/fix/ci_errors
Fix/ci errors
2 parents b62ada6 + 5df3270 commit 5cc39d6

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/release-cli.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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:
@@ -22,8 +26,6 @@ jobs:
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: |
@@ -39,6 +41,10 @@ jobs:
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

Comments
 (0)