Added first workflows for building docs and ci/cd

This commit is contained in:
Jonas Dellinger 2020-11-14 09:40:07 +01:00
parent c2b118a9b3
commit b14fa9547f
4 changed files with 70 additions and 31 deletions

27
.github/workflows/cicd.yaml vendored Normal file
View File

@ -0,0 +1,27 @@
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:
dotnet-version: "2.2.x"
- uses: actions/setup-dotnet@v1
with:
dotnet-version: "5.0.x"
- name: Restore Packages
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --verbosity minimal
- name: Test
run: dotnet test SpotifyAPI.Web.Tests

18
.github/workflows/docs.yaml vendored Normal file
View File

@ -0,0 +1,18 @@
name: Build/Deploy Documentation
on:
push:
branches: [$default-branch]
jobs:
build-deploy-docs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.JS
uses: actions/setup-node@v1
with:
node-version: 14.15.0
- name: Build & Deploy Documentation
run: ./SpotifyAPI.Docs/docs.sh

View File

@ -2,8 +2,6 @@
set -e
if [ -z "$APPVEYOR_PULL_REQUEST_NUMBER" ]; then
if [ "$APPVEYOR_REPO_BRANCH" = "master" ]; then
echo "Building docs..."
echo "$GH_DEPLOY_TOKEN" | base64 -d > "$HOME/.ssh/id_rsa"
@ -11,10 +9,8 @@ if [ -z "$APPVEYOR_PULL_REQUEST_NUMBER" ]; then
chmod 600 ~/.ssh/id_rsa
git config --global user.email "jonas@dellinger.dev"
git config --global user.name "AppVeyor Docs Builder"
git config --global user.name "GH Actions Docs Builder"
cd ./SpotifyAPI.Docs
yarn
USE_SSH=true GIT_USER=JohnnyCrazy yarn deploy
fi
fi

View File

@ -2,7 +2,6 @@
set -e
if [ "$APPVEYOR_REPO_TAG" = "true" ]; then
echo "Publishing..."
sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
@ -23,4 +22,3 @@ if [ "$APPVEYOR_REPO_TAG" = "true" ]; then
-Source https://www.nuget.org/api/v2/package
cd ..
fi