mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-23 06:36:26 +00:00
Added publishing to CI/CD if tag is present
This commit is contained in:
parent
4aeca5216d
commit
adfc64b957
19
.github/workflows/cicd.yaml
vendored
19
.github/workflows/cicd.yaml
vendored
@ -19,9 +19,28 @@ jobs:
|
||||
- uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: "5.0.x"
|
||||
- name: Set RELEASE_VERSION
|
||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||
- name: Restore Packages
|
||||
run: dotnet restore
|
||||
- name: Build
|
||||
run: dotnet build --configuration Release --verbosity minimal
|
||||
- name: Test
|
||||
run: dotnet test SpotifyAPI.Web.Tests
|
||||
- name: Publish to NuGET
|
||||
run: ./publish.sh
|
||||
if: startsWith( github.ref, 'refs/tags/')
|
||||
env:
|
||||
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
|
||||
- name: Publish to GH Release
|
||||
uses: actions/create-release@v1
|
||||
if: startsWith( github.ref, 'refs/tags/')
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: SpotifyAPI Web ${{ RELEASE_VERSION }}
|
||||
body: |
|
||||
TODO
|
||||
draft: true
|
||||
prerelease: false
|
||||
|
@ -26,7 +26,7 @@
|
||||
<NoWarn>1591</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(APPVEYOR)' == 'true'">
|
||||
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
|
||||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
|
11
publish.sh
11
publish.sh
@ -4,19 +4,16 @@ set -e
|
||||
|
||||
echo "Publishing..."
|
||||
|
||||
sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
|
||||
alias nuget="mono /usr/local/bin/nuget.exe"
|
||||
|
||||
cd ./SpotifyAPI.Web
|
||||
dotnet pack -c Release SpotifyAPI.Web.csproj -p:PackageVersion="$APPVEYOR_REPO_TAG_NAME"
|
||||
nuget push "./bin/Release/SpotifyAPI.Web.$APPVEYOR_REPO_TAG_NAME.nupkg"\
|
||||
dotnet pack -c Release SpotifyAPI.Web.csproj -p:PackageVersion="$RELEASE_VERSION"
|
||||
nuget push "./bin/Release/SpotifyAPI.Web.$RELEASE_VERSION.nupkg"\
|
||||
-ApiKey "$NUGET_TOKEN"\
|
||||
-NonInteractive\
|
||||
-Source https://www.nuget.org/api/v2/package
|
||||
|
||||
cd ../SpotifyAPI.Web.Auth
|
||||
dotnet pack -c Release SpotifyAPI.Web.Auth.csproj -p:PackageVersion="$APPVEYOR_REPO_TAG_NAME"
|
||||
nuget push "./bin/Release/SpotifyAPI.Web.Auth.$APPVEYOR_REPO_TAG_NAME.nupkg"\
|
||||
dotnet pack -c Release SpotifyAPI.Web.Auth.csproj -p:PackageVersion="$RELEASE_VERSION"
|
||||
nuget push "./bin/Release/SpotifyAPI.Web.Auth.$RELEASE_VERSION.nupkg"\
|
||||
-ApiKey "$NUGET_TOKEN"\
|
||||
-NonInteractive\
|
||||
-Source https://www.nuget.org/api/v2/package
|
||||
|
Loading…
Reference in New Issue
Block a user