Skip to content

Commit c408cfa

Browse files
committed
💚 fix CI
1 parent 4f8733f commit c408cfa

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

.github/workflows/publish.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- uses: actions/checkout@v4
24+
25+
- name: Get name, version, and group from csproj files
26+
id: get_version
27+
run: |
28+
set -e
29+
VERSION=$(awk -F'[<>]' '/^[[:space:]]*<Version>/ {print $3}' QsNet/QsNet.csproj)
30+
echo "VERSION=$VERSION" >> $GITHUB_ENV
2431
2532
- name: Setup .NET
2633
uses: actions/setup-dotnet@v4
@@ -32,18 +39,16 @@ jobs:
3239

3340
- name: Build & Pack
3441
run: dotnet pack QsNet/QsNet.csproj -c Release -o ./artifacts
35-
42+
3643
- name: Push to NuGet
37-
run: dotnet nuget push ./artifacts/*.nupkg \
38-
--api-key ${{ secrets.NUGET_API_KEY }} \
39-
--source https://api.nuget.org/v3/index.json \
40-
--skip-duplicate
44+
run: dotnet nuget push ./artifacts/QsNet.$VERSION.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
4145

4246
- name: Upload .nupkg artefact
4347
uses: actions/upload-artifact@v4
4448
with:
4549
name: nuget-package
4650
path: ./artifacts/*.nupkg
51+
retention-days: 7
4752
release:
4853
needs:
4954
- test
@@ -54,21 +59,19 @@ jobs:
5459
contents: write
5560
steps:
5661
- uses: actions/checkout@v4
57-
- name: Get name, version, and group from Gradle files
58-
id: get_version_and_name
62+
- name: Get name, version, and group from csproj files
63+
id: get_version
5964
run: |
6065
set -e
6166
VERSION=$(awk -F'[<>]' '/^[[:space:]]*<Version>/ {print $3}' QsNet/QsNet.csproj)
62-
NAME=$(awk -F'[<>]' '/<PackageId>/ {print $3}' QsNet/QsNet.csproj)
6367
echo "VERSION=$VERSION" >> $GITHUB_ENV
64-
echo "NAME=$NAME" >> $GITHUB_ENV
6568
- name: Create tag-specific CHANGELOG
6669
id: create_changelog
6770
run: |
6871
set -e
6972
CHANGELOG_PATH=$RUNNER_TEMP/CHANGELOG.md
7073
awk '/^##[[:space:]].*/ { if (count == 1) exit; count++; print } count == 1 && !/^##[[:space:]].*/ { print }' CHANGELOG.md | sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' > $CHANGELOG_PATH
71-
echo -en "\n[https://www.nuget.org/packages/$NAME](https://www.nuget.org/packages/$NAME)" >> $CHANGELOG_PATH
74+
echo -en "\n[https://www.nuget.org/packages/QsNet](https://www.nuget.org/packages/QsNet)" >> $CHANGELOG_PATH
7275
echo "CHANGELOG_PATH=$CHANGELOG_PATH" >> $GITHUB_ENV
7376
- name: Create release
7477
id: create_release

.github/workflows/test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ jobs:
9595
name: test-results-${{ matrix.dotnet }}
9696
path: '**/*.trx'
9797
overwrite: true
98+
retention-days: 7
9899

99100
- name: Upload raw coverage
100101
uses: actions/upload-artifact@v4
@@ -103,6 +104,7 @@ jobs:
103104
path: QsNet.Tests/TestResults/**/*.cobertura.xml
104105
if-no-files-found: error
105106
overwrite: true
107+
retention-days: 7
106108

107109
coverage:
108110
name: Coverage (merged)
@@ -154,4 +156,5 @@ jobs:
154156
uses: actions/upload-artifact@v4
155157
with:
156158
name: coverage-report
157-
path: coverage/report/
159+
path: coverage/report/
160+
retention-days: 7

0 commit comments

Comments
 (0)