Skip to content

Commit 5d1516c

Browse files
committed
port GH actions config from main
1 parent 0c7d11c commit 5d1516c

2 files changed

Lines changed: 22 additions & 33 deletions

File tree

.github/workflows/main.yml

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Main PR/push + stable push
1+
name: main PR+push / stable push
22

33
on:
44
push:
@@ -8,11 +8,9 @@ on:
88

99
jobs:
1010
build:
11-
1211
runs-on: ubuntu-latest
13-
12+
1413
env:
15-
dotnet_sdk_version: '5.0.x'
1614
DOTNET_CLI_TELEMETRY_OPTOUT: true
1715
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
1816
TEST_BUNGIE_API_KEY: ${{ secrets.TEST_BUNGIE_API_KEY }}
@@ -21,34 +19,27 @@ jobs:
2119
- name: Checkout
2220
uses: actions/checkout@v2
2321

24-
- name: Get short SHA
25-
uses: benjlevesque/short-sha@v1.2
26-
id: short-sha
27-
with:
28-
length: 8
22+
- name: Get version suffix
23+
id: get_suffix
24+
run: echo ::set-output name=SUFFIX::${GITHUB_SHA:0:9}
2925

30-
- name: Setup .NET
26+
- name: Setup .NET 5
3127
uses: actions/setup-dotnet@v1
3228
with:
33-
dotnet-version: ${{ env.dotnet_sdk_version }}
34-
35-
- name: Build client
36-
run: dotnet build ./BungieSharper -c Release
29+
dotnet-version: 5.0.x
30+
include-prerelease: false
3731

3832
- name: Pack entities NuGet package
39-
run: dotnet pack ./BungieSharper.Entities -c Release --no-build --output OutputPackage --version-suffix "ci.$(date -u +%Y%m%dT%H%M%S)+sha.${GITHUB_SHA:0:9}" -p:ContinuousIntegrationBuild=true
33+
run: dotnet pack ./BungieSharper.Entities -c Release --output OutputPackage -p:ContinuousIntegrationBuild=true -p:VersionSuffix=${{ steps.get_suffix.outputs.SUFFIX }}
4034

4135
- name: Pack client NuGet package
42-
run: dotnet pack ./BungieSharper -c Release --no-build --output OutputPackage --version-suffix "ci.$(date -u +%Y%m%dT%H%M%S)+sha.${GITHUB_SHA:0:9}" -p:ContinuousIntegrationBuild=true
36+
run: dotnet pack ./BungieSharper -c Release --output OutputPackage -p:ContinuousIntegrationBuild=true -p:VersionSuffix=${{ steps.get_suffix.outputs.SUFFIX }}
4337

4438
- name: Upload artifact (nupkg/snupkg)
4539
uses: actions/upload-artifact@v1
4640
with:
47-
name: BungieSharper - ${{ env.SHA }}
41+
name: BungieSharper_${{ steps.get_suffix.outputs.SUFFIX }}
4842
path: OutputPackage
4943

50-
- name: Build test
51-
run: dotnet build ./BungieSharper.Tests -c Release
52-
5344
- name: Run test
54-
run: dotnet test ./BungieSharper.Tests -c Release --no-build --verbosity normal
45+
run: dotnet test ./BungieSharper.Tests -c Release --verbosity normal

.github/workflows/release.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88
jobs:
99
build:
1010
runs-on: ubuntu-latest
11+
1112
env:
12-
dotnet_sdk_version: '5.0.x'
1313
DOTNET_CLI_TELEMETRY_OPTOUT: true
1414
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
1515
TEST_BUNGIE_API_KEY: ${{ secrets.TEST_BUNGIE_API_KEY }}
@@ -22,19 +22,17 @@ jobs:
2222
id: get_version
2323
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
2424

25-
- name: Setup .NET
25+
- name: Setup .NET 5
2626
uses: actions/setup-dotnet@v1
2727
with:
28-
dotnet-version: ${{ env.dotnet_sdk_version }}
29-
30-
- name: Build client
31-
run: dotnet build ./BungieSharper -c Release -p:Version=${{ steps.get_version.outputs.VERSION }}
28+
dotnet-version: 5.0.x
29+
include-prerelease: false
3230

3331
- name: Pack entities NuGet package
34-
run: dotnet pack ./BungieSharper.Entities -c Release --no-build --output Packages -p:ContinuousIntegrationBuild=true -p:Version=${{ steps.get_version.outputs.VERSION }}
32+
run: dotnet pack ./BungieSharper.Entities -c Release --output Packages -p:ContinuousIntegrationBuild=true -p:Version=${{ steps.get_version.outputs.VERSION }}
3533

3634
- name: Pack client NuGet package
37-
run: dotnet pack ./BungieSharper -c Release --no-build --output Packages -p:ContinuousIntegrationBuild=true -p:Version=${{ steps.get_version.outputs.VERSION }}
35+
run: dotnet pack ./BungieSharper -c Release --output Packages -p:ContinuousIntegrationBuild=true -p:Version=${{ steps.get_version.outputs.VERSION }}
3836

3937
- name: Create Release
4038
id: create_release
@@ -93,16 +91,16 @@ jobs:
9391

9492
- name: Upload entities to NuGet
9593
run: |
96-
dotnet nuget push ./Packages/BungieSharper.Entities.${{ steps.get_version.outputs.VERSION }}.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
94+
dotnet nuget push ./Packages/BungieSharper.Entities.${{ steps.get_version.outputs.VERSION }}.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
9795
9896
- name: Upload client to NuGet
9997
run: |
100-
dotnet nuget push ./Packages/BungieSharper.${{ steps.get_version.outputs.VERSION }}.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
98+
dotnet nuget push ./Packages/BungieSharper.${{ steps.get_version.outputs.VERSION }}.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
10199
102100
- name: Upload entities to GitHub Packages
103101
run: |
104-
dotnet nuget push ./Packages/BungieSharper.Entities.${{ steps.get_version.outputs.VERSION }}.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/ashakoor/index.json --skip-duplicate
102+
dotnet nuget push ./Packages/BungieSharper.Entities.${{ steps.get_version.outputs.VERSION }}.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/ashakoor/index.json
105103
106104
- name: Upload client to GitHub Packages
107105
run: |
108-
dotnet nuget push ./Packages/BungieSharper.${{ steps.get_version.outputs.VERSION }}.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/ashakoor/index.json --skip-duplicate
106+
dotnet nuget push ./Packages/BungieSharper.${{ steps.get_version.outputs.VERSION }}.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/ashakoor/index.json

0 commit comments

Comments
 (0)