Spotify.NET/.github/workflows/cicd.yaml

84 lines
3.2 KiB
YAML
Raw Normal View History

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@v4
- uses: actions/setup-dotnet@v3
with:
2023-05-27 20:50:57 +01:00
dotnet-version: "5.x"
- uses: actions/setup-dotnet@v3
with:
2023-05-27 20:50:57 +01:00
dotnet-version: "6.x"
- uses: actions/setup-dotnet@v3
with:
2024-02-10 10:56:20 +00:00
dotnet-version: "7.x"
- uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.x"
- name: Set RELEASE_VERSION
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Restore Packages
run: dotnet restore
2022-11-27 12:30:39 +00:00
- name: Lint
run: dotnet format --verify-no-changes
- 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 }}
2020-11-14 13:12:27 +00:00
release_name: SpotifyAPI Web ${{ github.ref }}
body: |
TODO
draft: true
prerelease: false
- name: Upload to GH Release
if: startsWith( github.ref, 'refs/tags/')
run: |
2023-11-03 22:23:54 +00:00
zip -j SpotifyAPI.Web-netstandard2.0.zip SpotifyAPI.Web/bin/Release/netstandard2.0/*
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/*
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/*
2024-02-10 10:56:20 +00:00
zip -j SpotifyAPI.Web-net8.0.zip SpotifyAPI.Web/bin/Release/net8.0/*
2023-11-03 22:23:54 +00:00
zip -j SpotifyAPI.Web.Auth-netstandard2.0.zip SpotifyAPI.Web.Auth/bin/Release/netstandard2.0/*
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/*
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/*
2024-02-10 10:56:20 +00:00
zip -j SpotifyAPI.Web.Auth-net8.0.zip SpotifyAPI.Web.Auth/bin/Release/net8.0/*
2023-11-03 22:52:20 +00:00
gh release upload "$RELEASE_VERSION" \
"SpotifyAPI.Web-netstandard2.0.zip" \
"SpotifyAPI.Web-netstandard2.1.zip" \
"SpotifyAPI.Web-net5.0.zip" \
"SpotifyAPI.Web-net6.0.zip" \
"SpotifyAPI.Web-net7.0.zip" \
2024-02-10 10:56:20 +00:00
"SpotifyAPI.Web-net8.0.zip" \
2023-11-03 22:52:20 +00:00
"SpotifyAPI.Web.Auth-netstandard2.0.zip" \
"SpotifyAPI.Web.Auth-netstandard2.1.zip" \
"SpotifyAPI.Web.Auth-net5.0.zip" \
"SpotifyAPI.Web.Auth-net6.0.zip" \
2024-02-10 11:25:47 +00:00
"SpotifyAPI.Web.Auth-net7.0.zip" \
2024-02-10 10:56:20 +00:00
"SpotifyAPI.Web.Auth-net8.0.zip"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}