Skip to content

Commit

Permalink
Update workflows (#132)
Browse files Browse the repository at this point in the history
* Update documentation workflow

* Update build and test workflow

* Update release workflow
  • Loading branch information
FantasyTeddy authored Jan 3, 2024
1 parent f98f80b commit 1f6afe6
Show file tree
Hide file tree
Showing 12 changed files with 112 additions and 156 deletions.
3 changes: 2 additions & 1 deletion .documentation/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
/**/packages/
/**/bin/
/**/obj/
_site
/_site
/api
5 changes: 0 additions & 5 deletions .documentation/api/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions .documentation/api/index.md

This file was deleted.

1 change: 0 additions & 1 deletion .documentation/articles/intro.md

This file was deleted.

2 changes: 0 additions & 2 deletions .documentation/articles/toc.yml

This file was deleted.

119 changes: 42 additions & 77 deletions .documentation/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,81 +3,59 @@
{
"src": [
{
"files": "Supabase.csproj",
"exclude": [
"**/bin/**",
"**/obj/**"
],
"src": "../Supabase"
"src": "../Supabase",
"files": [
"**/*.csproj"
]
},
{
"files": "Gotrue.csproj",
"exclude": [
"**/bin/**",
"**/obj/**"
],
"src": "../modules/gotrue-csharp/Gotrue"
"src": "../modules/gotrue-csharp/Gotrue",
"files": [
"**/*.csproj"
]
},
{
"files": "Realtime.csproj",
"exclude": [
"**/bin/**",
"**/obj/**"
],
"src": "../modules/realtime-csharp/Realtime"
"src": "../modules/realtime-csharp/Realtime",
"files": [
"**/*.csproj"
]
},
{
"files": "Postgrest.csproj",
"exclude": [
"**/bin/**",
"**/obj/**"
],
"src": "../modules/postgrest-csharp/Postgrest"
"src": "../modules/postgrest-csharp/Postgrest",
"files": [
"**/*.csproj"
]
},
{
"files": "Storage.csproj",
"exclude": [
"**/bin/**",
"**/obj/**"
],
"src": "../modules/storage-csharp/Storage"
"src": "../modules/storage-csharp/Storage",
"files": [
"**/*.csproj"
]
},
{
"files": "Functions.csproj",
"exclude": [
"**/bin/**",
"**/obj/**"
],
"src": "../modules/functions-csharp/Functions"
"src": "../modules/functions-csharp/Functions",
"files": [
"**/*.csproj"
]
},
{
"files": "Core.csproj",
"exclude": [
"**/bin/**",
"**/obj/**"
],
"src": "../modules/core-csharp/Core"
"src": "../modules/core-csharp/Core",
"files": [
"**/*.csproj"
]
}
],
"dest": "api",
"disableGitFeatures": false,
"disableDefaultFilter": false
"dest": "api"
}
],
"build": {
"content": [
{
"files": [
"api/**.yml",
"api/index.md"
]
},
{
"files": [
"articles/**.md",
"articles/**/toc.yml",
"toc.yml",
"*.md"
"**/*.{md,yml}"
],
"exclude": [
"_site/**"
]
}
],
Expand All @@ -88,28 +66,15 @@
]
}
],
"overwrite": [
{
"files": [
"apidoc/**.md"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"dest": "_site",
"globalMetadataFiles": [],
"fileMetadataFiles": [],
"output": "_site",
"template": [
"default"
"default",
"modern"
],
"postProcessors": [],
"markdownEngineName": "markdig",
"noLangKeyword": false,
"keepFileLink": false,
"cleanupCacheHistory": false,
"disableGitFeatures": false
"globalMetadata": {
"_appName": "supabase-csharp",
"_appTitle": "supabase-csharp",
"_enableSearch": true
}
}
}
}
9 changes: 5 additions & 4 deletions .documentation/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This is the **HOMEPAGE**.
Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files.
## Quick Start Notes:
1. Add images to the *images* folder if the file is referencing an image.
---
_layout: landing
---

# supabase-csharp
5 changes: 1 addition & 4 deletions .documentation/toc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
- name: Articles
href: articles/
- name: Api Documentation
- name: API
href: api/
homepage: api/index.md
37 changes: 37 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build and Test

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build-and-test:
runs-on: ubuntu-latest

env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
AWS_REGION: ${{ secrets.AWS_REGION }}

steps:
- uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Initialize Testing Stack
run: docker-compose up -d

- name: Test
run: dotnet test --no-restore
22 changes: 13 additions & 9 deletions .github/workflows/build-documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,24 @@ jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: "true"
persist-credentials: false

- uses: nikeee/[email protected]
name: Build Documentation
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
args: .documentation/docfx.json
dotnet-version: 8.x

- name: Install docfx
run: dotnet tool update -g docfx

- name: Build documentation
run: docfx .documentation/docfx.json

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@3.7.1
uses: JamesIves/github-pages-deploy-action@v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: .documentation/_site # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch
folder: .documentation/_site
token: ${{ secrets.GITHUB_TOKEN }}
37 changes: 0 additions & 37 deletions .github/workflows/dotnet-core.yml

This file was deleted.

26 changes: 12 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
name: Publish Nuget Package
name: Publish NuGet Package

on:
push:
branches:
- release/* # Default release branch

jobs:
publish:
name: build, pack & publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-version: 8.x

- name: Wait for tests to succeed
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: 'buildAndTest'
check-name: build-and-test
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10

- name: Install dependencies
run: dotnet restore
- name: Generate package
run: dotnet pack ./Supabase/Supabase.csproj --configuration Release

- name: Build Realtime
run: dotnet build ./Supabase/Supabase.csproj --configuration Release --no-restore

# Publish
- name: publish on version change
run: nuget push "**/*.nupkg" -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}
- name: Publish on version change
run: dotnet nuget push "**/*.nupkg" --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}

0 comments on commit 1f6afe6

Please sign in to comment.