Skip to content

Commit b14fa95

Browse files
committed
Added first workflows for building docs and ci/cd
1 parent c2b118a commit b14fa95

4 files changed

Lines changed: 70 additions & 31 deletions

File tree

‎.github/workflows/cicd.yaml‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build/Test/Release SpotifyAPI-NET
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
spotifyapi-net-cicd:
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
- uses: actions/setup-dotnet@v1
14+
with:
15+
dotnet-version: "3.1.x"
16+
- uses: actions/setup-dotnet@v1
17+
with:
18+
dotnet-version: "2.2.x"
19+
- uses: actions/setup-dotnet@v1
20+
with:
21+
dotnet-version: "5.0.x"
22+
- name: Restore Packages
23+
run: dotnet restore
24+
- name: Build
25+
run: dotnet build --configuration Release --verbosity minimal
26+
- name: Test
27+
run: dotnet test SpotifyAPI.Web.Tests

‎.github/workflows/docs.yaml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Build/Deploy Documentation
2+
3+
on:
4+
push:
5+
branches: [$default-branch]
6+
7+
jobs:
8+
build-deploy-docs:
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
- name: Use Node.JS
14+
uses: actions/setup-node@v1
15+
with:
16+
node-version: 14.15.0
17+
- name: Build & Deploy Documentation
18+
run: ./SpotifyAPI.Docs/docs.sh

‎SpotifyAPI.Docs/docs.sh‎

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,15 @@
22

33
set -e
44

5-
if [ -z "$APPVEYOR_PULL_REQUEST_NUMBER" ]; then
6-
if [ "$APPVEYOR_REPO_BRANCH" = "master" ]; then
7-
echo "Building docs..."
5+
echo "Building docs..."
86

9-
echo "$GH_DEPLOY_TOKEN" | base64 -d > "$HOME/.ssh/id_rsa"
10-
chmod 700 ~/.ssh
11-
chmod 600 ~/.ssh/id_rsa
7+
echo "$GH_DEPLOY_TOKEN" | base64 -d > "$HOME/.ssh/id_rsa"
8+
chmod 700 ~/.ssh
9+
chmod 600 ~/.ssh/id_rsa
1210

13-
git config --global user.email "jonas@dellinger.dev"
14-
git config --global user.name "AppVeyor Docs Builder"
11+
git config --global user.email "jonas@dellinger.dev"
12+
git config --global user.name "GH Actions Docs Builder"
1513

16-
cd ./SpotifyAPI.Docs
17-
yarn
18-
USE_SSH=true GIT_USER=JohnnyCrazy yarn deploy
19-
fi
20-
fi
14+
cd ./SpotifyAPI.Docs
15+
yarn
16+
USE_SSH=true GIT_USER=JohnnyCrazy yarn deploy

‎publish.sh‎

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,23 @@
22

33
set -e
44

5-
if [ "$APPVEYOR_REPO_TAG" = "true" ]; then
6-
echo "Publishing..."
5+
echo "Publishing..."
76

8-
sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
9-
alias nuget="mono /usr/local/bin/nuget.exe"
7+
sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
8+
alias nuget="mono /usr/local/bin/nuget.exe"
109

11-
cd ./SpotifyAPI.Web
12-
dotnet pack -c Release SpotifyAPI.Web.csproj -p:PackageVersion="$APPVEYOR_REPO_TAG_NAME"
13-
nuget push "./bin/Release/SpotifyAPI.Web.$APPVEYOR_REPO_TAG_NAME.nupkg"\
14-
-ApiKey "$NUGET_TOKEN"\
15-
-NonInteractive\
16-
-Source https://www.nuget.org/api/v2/package
10+
cd ./SpotifyAPI.Web
11+
dotnet pack -c Release SpotifyAPI.Web.csproj -p:PackageVersion="$APPVEYOR_REPO_TAG_NAME"
12+
nuget push "./bin/Release/SpotifyAPI.Web.$APPVEYOR_REPO_TAG_NAME.nupkg"\
13+
-ApiKey "$NUGET_TOKEN"\
14+
-NonInteractive\
15+
-Source https://www.nuget.org/api/v2/package
1716

18-
cd ../SpotifyAPI.Web.Auth
19-
dotnet pack -c Release SpotifyAPI.Web.Auth.csproj -p:PackageVersion="$APPVEYOR_REPO_TAG_NAME"
20-
nuget push "./bin/Release/SpotifyAPI.Web.Auth.$APPVEYOR_REPO_TAG_NAME.nupkg"\
21-
-ApiKey "$NUGET_TOKEN"\
22-
-NonInteractive\
23-
-Source https://www.nuget.org/api/v2/package
17+
cd ../SpotifyAPI.Web.Auth
18+
dotnet pack -c Release SpotifyAPI.Web.Auth.csproj -p:PackageVersion="$APPVEYOR_REPO_TAG_NAME"
19+
nuget push "./bin/Release/SpotifyAPI.Web.Auth.$APPVEYOR_REPO_TAG_NAME.nupkg"\
20+
-ApiKey "$NUGET_TOKEN"\
21+
-NonInteractive\
22+
-Source https://www.nuget.org/api/v2/package
2423

25-
cd ..
26-
fi
24+
cd ..

0 commit comments

Comments
 (0)