Skip to content

Commit

Permalink
feat: Updated to new workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Aug 21, 2024
1 parent 71beb32 commit 66aea2f
Show file tree
Hide file tree
Showing 108 changed files with 7,896 additions and 100 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/auto-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Opens a new PR if there are OpenAPI updates
on:
schedule:
- cron: '0 */3 * * *'

permissions:
contents: write
pull-requests: write
actions: write

jobs:
check-openapi-updates:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Git user
run: |
git config --local user.email "[email protected]"
git config --local user.name "github-actions[bot]"
- name: Generate branch name
id: branch
run: echo "branch_name=bot/update-openapi_$(date +'%Y%m%d%H%M')" >> $GITHUB_OUTPUT

- name: Create branch
run: |
git checkout -b ${{ steps.branch.outputs.branch_name }} origin/main
git rebase main
- name: Generate code
run: |
cd src/libs/Replicate
chmod +x ./generate.sh
./generate.sh
- name: Check for changes
id: changes
run: |
CHANGED=$(git diff --name-only)
if [ -z "$CHANGED" ]; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Push changes
if: steps.changes.outputs.has_changes == 'true'
run: |
git add .
git commit -m "feat: Updated OpenAPI spec"
git push --force-with-lease -u origin ${{ steps.branch.outputs.branch_name }}
- name: Wait for 15 seconds
if: steps.changes.outputs.has_changes == 'true'
run: sleep 15

- name: Create pull request
if: steps.changes.outputs.has_changes == 'true'
run: gh pr create -B main -H ${{ steps.branch.outputs.branch_name }} --title 'feat:@coderabbitai' --body '@coderabbitai summary'
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
30 changes: 26 additions & 4 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
name: Build, test and publish
name: Publish
on:
push:
branches:
- main
tags:
- v*

permissions:
contents: write

jobs:
build-test-publish:
name: Build, test and publish
publish:
name: Publish
uses: HavenDV/workflows/.github/workflows/dotnet_build-test-publish.yml@main
with:
generate-build-number: false
conventional-commits-publish-conditions: false
enable-caching: false
additional-test-arguments: '--logger GitHubActions'
secrets:
nuget-key: ${{ secrets.NUGET_KEY }}
nuget-key: ${{ secrets.NUGET_KEY }}

release:
name: Release
runs-on: ubuntu-latest
needs: [publish]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Create release
run: gh release create ${{ github.ref_name }}
--title "${{ github.ref_name }}"
--generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56 changes: 56 additions & 0 deletions .github/workflows/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: MKDocs Deploy
on:
push:
branches:
- main
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'examples/**'
- 'src/helpers/GenerateDocs/**'
- '.github/workflows/mkdocs.yml'

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Install dependencies
run: pip install mkdocs-material

- name: Generate docs
run: dotnet run --project src/helpers/GenerateDocs/GenerateDocs.csproj .

- name: Build with MkDocs
run: mkdocs build -d ./_site

- name: Upload artifact
uses: actions/upload-pages-artifact@v3

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
30 changes: 24 additions & 6 deletions Replicate.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
docs\openapi.json = docs\openapi.json
.github\workflows\pull-request.yml = .github\workflows\pull-request.yml
.github\workflows\auto-update.yml = .github\workflows\auto-update.yml
.github\workflows\mkdocs.yml = .github\workflows\mkdocs.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libs", "libs", "{61E7E11E-4558-434C-ACE8-06316A3097B3}"
Expand All @@ -26,7 +28,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Replicate", "src\libs\Repli
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Replicate.IntegrationTests", "src\tests\Replicate.IntegrationTests\Replicate.IntegrationTests.csproj", "{592ADBC9-C951-4AF7-A163-B6C63B970B19}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Replicate.Models", "src\libs\Replicate.Models\Replicate.Models.csproj", "{B5C719C1-9F51-4874-9FBF-2D62CCCDBD1B}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "helpers", "helpers", "{4A7E933D-CAA6-4A0E-A762-BE49BE291515}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FixOpenApiSpec", "src\helpers\FixOpenApiSpec\FixOpenApiSpec.csproj", "{51395B9A-1474-4263-AB97-CFBEED8BAD3F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenerateDocs", "src\helpers\GenerateDocs\GenerateDocs.csproj", "{2E3D948F-EDC6-4B62-9ED1-0ABADABD4EAA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TrimmingHelper", "src\helpers\TrimmingHelper\TrimmingHelper.csproj", "{AF5820E5-E366-4DB2-B9D6-A7811637CE0B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -42,18 +50,28 @@ Global
{592ADBC9-C951-4AF7-A163-B6C63B970B19}.Debug|Any CPU.Build.0 = Debug|Any CPU
{592ADBC9-C951-4AF7-A163-B6C63B970B19}.Release|Any CPU.ActiveCfg = Release|Any CPU
{592ADBC9-C951-4AF7-A163-B6C63B970B19}.Release|Any CPU.Build.0 = Release|Any CPU
{B5C719C1-9F51-4874-9FBF-2D62CCCDBD1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B5C719C1-9F51-4874-9FBF-2D62CCCDBD1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B5C719C1-9F51-4874-9FBF-2D62CCCDBD1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B5C719C1-9F51-4874-9FBF-2D62CCCDBD1B}.Release|Any CPU.Build.0 = Release|Any CPU
{51395B9A-1474-4263-AB97-CFBEED8BAD3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{51395B9A-1474-4263-AB97-CFBEED8BAD3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{51395B9A-1474-4263-AB97-CFBEED8BAD3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{51395B9A-1474-4263-AB97-CFBEED8BAD3F}.Release|Any CPU.Build.0 = Release|Any CPU
{2E3D948F-EDC6-4B62-9ED1-0ABADABD4EAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E3D948F-EDC6-4B62-9ED1-0ABADABD4EAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E3D948F-EDC6-4B62-9ED1-0ABADABD4EAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E3D948F-EDC6-4B62-9ED1-0ABADABD4EAA}.Release|Any CPU.Build.0 = Release|Any CPU
{AF5820E5-E366-4DB2-B9D6-A7811637CE0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AF5820E5-E366-4DB2-B9D6-A7811637CE0B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AF5820E5-E366-4DB2-B9D6-A7811637CE0B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AF5820E5-E366-4DB2-B9D6-A7811637CE0B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{0028BC85-0064-4CE8-A21A-C1F5E922BD59} = {61E7E11E-4558-434C-ACE8-06316A3097B3}
{592ADBC9-C951-4AF7-A163-B6C63B970B19} = {AAA11B78-2764-4520-A97E-46AA7089A588}
{B5C719C1-9F51-4874-9FBF-2D62CCCDBD1B} = {61E7E11E-4558-434C-ACE8-06316A3097B3}
{51395B9A-1474-4263-AB97-CFBEED8BAD3F} = {4A7E933D-CAA6-4A0E-A762-BE49BE291515}
{2E3D948F-EDC6-4B62-9ED1-0ABADABD4EAA} = {4A7E933D-CAA6-4A0E-A762-BE49BE291515}
{AF5820E5-E366-4DB2-B9D6-A7811637CE0B} = {4A7E933D-CAA6-4A0E-A762-BE49BE291515}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CED9A020-DBA5-4BE6-8096-75E528648EC1}
Expand Down
102 changes: 102 additions & 0 deletions docs/css/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/* Logo title */
.md-header__topic:first-child {
font-weight: initial !important;
}

/* Code font size in <details> */
details .linenos, details code {
font-size: inherit !important;
}

/* Code block / tab in details */
details > summary + .highlight:last-child, details > summary + .tabbed-set:last-child { margin: 0 -0.6rem !important; }
details > summary + .highlight:last-child > .highlighttable { margin: 0 !important; }

/* Table full width */
.md-typeset__table { display: block !important; }
.md-typeset table:not(.highlighttable) { display: table !important; }

.md-typeset table:not([class]) th {
min-width: 0rem;
}

.headerlink { transform: translateY(-2.5px); }

.md-nav__link[for=__toc] .md-icon { margin-left: auto !important; }

blockquote.page-time {
margin: 20px 0 !important;
border-left-color: #64b5f6 !important; /* Just change the color value and that's it*/
}
blockquote.page-copyright {
margin: 20px 0 !important;
border-left-color: #ff1700 !important; /* Just change the color value and that's it*/
}
blockquote.page-copyright i.md-icon {
display: inline-block;
margin-right: 5px;
transform: translateY(3.5px);
width: 18px;
}

#myBtn {
display: none;
position: fixed;
bottom: 100px;
right: 16px;
z-index: 99;
border: none;
outline: none;
color: #8590a6;
cursor: pointer;
padding: .7rem;
border-radius: .4rem;
}

#myBtn:hover {
background-color: #d3d3d3;
}

#color-button > button {
cursor: pointer;
transition: opacity .25s;
display: inline-block;
width: 6.5rem;
margin-bottom: 0.2rem;
padding: 1.2rem 0.4rem 0.2rem;
font-size: 0.64rem;
text-align: left;
}

#color-button > button[data-md-color-primary] {
background-color: var(--md-primary-fg-color);
color: var(--md-primary-bg-color);
}
#color-button > button[data-md-color-primary=white] {
box-shadow: inset 0 0 0.05rem rgb(0 0 0 / 54%);
}

#color-button > button[data-md-color-accent] {
background-color: var(--md-accent-fg-color);
color: var(--md-code-bg-color);
}

mjx-container > img {
width: 0;
height: 0;
}

[data-md-color-scheme="slate"] {
--md-primary-fg-color: #2e303e;
--md-accent-fg-color: #00bda4;
--md-typeset-a-color: #526cfe;
}

[data-md-color-scheme="slate"] .md-typeset img {
background: white;
filter: brightness(0.9);
}

[data-md-color-scheme="slate"] .md-typeset img[src$=".svg"] {
border: 4px solid white;
}
Binary file added docs/media/icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"rollForward": "latestMajor",
"allowPrerelease": false
}
}
Loading

0 comments on commit 66aea2f

Please sign in to comment.