2020-11-14 08:40:07 +00:00
|
|
|
name: Build/Test/Release SpotifyAPI-NET
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
spotifyapi-net-cicd:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-dotnet@v1
|
|
|
|
with:
|
|
|
|
dotnet-version: "3.1.x"
|
|
|
|
- uses: actions/setup-dotnet@v1
|
|
|
|
with:
|
2021-11-10 19:12:12 +00:00
|
|
|
dotnet-version: "5.0.x"
|
2020-11-14 08:40:07 +00:00
|
|
|
- uses: actions/setup-dotnet@v1
|
|
|
|
with:
|
2021-11-10 19:12:12 +00:00
|
|
|
dotnet-version: "6.0.x"
|
2022-11-18 10:52:00 +00:00
|
|
|
- uses: actions/setup-dotnet@v1
|
|
|
|
with:
|
|
|
|
dotnet-version: "7.0.x"
|
2020-11-14 09:21:38 +00:00
|
|
|
- name: Set RELEASE_VERSION
|
|
|
|
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
2020-11-14 08:40:07 +00:00
|
|
|
- name: Restore Packages
|
|
|
|
run: dotnet restore
|
2022-11-27 12:30:39 +00:00
|
|
|
- name: Lint
|
|
|
|
run: dotnet format --verify-no-changes
|
2020-11-14 08:40:07 +00:00
|
|
|
- name: Build
|
|
|
|
run: dotnet build --configuration Release --verbosity minimal
|
|
|
|
- name: Test
|
|
|
|
run: dotnet test SpotifyAPI.Web.Tests
|
2020-11-14 09:21:38 +00:00
|
|
|
- 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 }}
|
2020-11-14 13:12:27 +00:00
|
|
|
release_name: SpotifyAPI Web ${{ github.ref }}
|
2020-11-14 09:21:38 +00:00
|
|
|
body: |
|
|
|
|
TODO
|
|
|
|
draft: true
|
|
|
|
prerelease: false
|
2020-11-14 09:52:47 +00:00
|
|
|
- name: Upload to GH Release
|
|
|
|
if: startsWith( github.ref, 'refs/tags/')
|
|
|
|
run: |
|
|
|
|
zip -j SpotifyAPI.Web-netstandard2.1.zip SpotifyAPI.Web/bin/Release/netstandard2.1/*
|
|
|
|
zip -j SpotifyAPI.Web-net5.0.zip SpotifyAPI.Web/bin/Release/net5.0/*
|
2021-11-10 19:12:12 +00:00
|
|
|
zip -j SpotifyAPI.Web-net6.0.zip SpotifyAPI.Web/bin/Release/net6.0/*
|
2022-11-18 10:52:00 +00:00
|
|
|
zip -j SpotifyAPI.Web-net7.0.zip SpotifyAPI.Web/bin/Release/net7.0/*
|
2020-11-14 09:52:47 +00:00
|
|
|
|
|
|
|
zip -j SpotifyAPI.Web.Auth-netstandard2.1.zip SpotifyAPI.Web.Auth/bin/Release/netstandard2.1/*
|
|
|
|
zip -j SpotifyAPI.Web.Auth-net5.0.zip SpotifyAPI.Web.Auth/bin/Release/net5.0/*
|
2021-11-10 19:12:12 +00:00
|
|
|
zip -j SpotifyAPI.Web.Auth-net6.0.zip SpotifyAPI.Web.Auth/bin/Release/net6.0/*
|
2022-11-18 10:52:00 +00:00
|
|
|
zip -j SpotifyAPI.Web.Auth-net7.0.zip SpotifyAPI.Web.Auth/bin/Release/net7.0/*
|
2020-11-14 09:52:47 +00:00
|
|
|
|
|
|
|
hub release edit \
|
|
|
|
-a "SpotifyAPI.Web-netstandard2.1.zip" \
|
|
|
|
-a "SpotifyAPI.Web-net5.0.zip" \
|
2021-11-10 19:12:12 +00:00
|
|
|
-a "SpotifyAPI.Web-net6.0.zip" \
|
2022-11-18 10:52:00 +00:00
|
|
|
-a "SpotifyAPI.Web-net7.0.zip" \
|
2020-11-14 09:52:47 +00:00
|
|
|
-a "SpotifyAPI.Web.Auth-netstandard2.1.zip" \
|
|
|
|
-a "SpotifyAPI.Web.Auth-net5.0.zip" \
|
2021-11-10 19:12:12 +00:00
|
|
|
-a "SpotifyAPI.Web.Auth-net6.0.zip" \
|
2022-11-18 10:52:00 +00:00
|
|
|
-a "SpotifyAPI.Web.Auth-net7.0.zip" \
|
2020-11-14 13:12:27 +00:00
|
|
|
-m "" "$RELEASE_VERSION"
|
2020-11-14 09:52:47 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|