Skip to content

Commit f34ac6d

Browse files
Initial commit
0 parents  commit f34ac6d

38 files changed

+2163
-0
lines changed

.devcontainer.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/jekyll
3+
{
4+
"name": "Stravaig Docs (Jekyll)",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/jekyll:1-bullseye",
7+
"customizations": {
8+
"vscode": {
9+
"extensions": [
10+
"ms-vscode.powershell",
11+
"github.vscode-github-actions"
12+
]
13+
}
14+
},
15+
"portsAttributes": {
16+
"4002": {
17+
"label": "scd-jekyll-server"
18+
}
19+
},
20+
21+
// Features to add to the dev container. More info: https://containers.dev/features.
22+
"features": {
23+
"ghcr.io/devcontainers/features/powershell:1": {
24+
"version": "latest"
25+
}
26+
},
27+
28+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
29+
// "forwardPorts": [],
30+
31+
// Uncomment the next line to run commands after the container is created.
32+
"postCreateCommand": "bash docs/scripts/bootstrap.sh",
33+
34+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
35+
// "remoteUser": "root"
36+
37+
"remoteEnv": {
38+
"JEKYLL_PORT": "4002",
39+
"REPO_NAME": "Stravaig-template"
40+
}
41+
}

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Docs: https://EditorConfig.org
2+
# Plug in for Visual Studio Code: https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig
3+
4+
# top-most EditorConfig file
5+
root = true
6+
7+
# General settings for the repo
8+
trim_trailing_whitespace=true # Remove whitespace at the end of lines
9+
charset: utf-8
10+
insert_final_newline=true

.gitattributes

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text=auto
3+
4+
# Explicitly declare text files you want to always be normalized and converted
5+
# to native line endings on checkout.
6+
*.cs text
7+
*.json text
8+
*.md text
9+
*.ps1 text
10+
*.sh text
11+
*.txt text
12+
*.yml text
13+
14+
# Declare files that will always have CRLF line endings on checkout.
15+
*.sln text eol=crlf
16+
17+
# Denote all files that are truly binary and should not be modified.
18+
*.png binary
19+
*.jpg binary
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# <title>
2+
3+
<!--
4+
Thank you for taking the time to contribute to this project.
5+
6+
Please, fill in all the sections.
7+
Replace items surrounded by chevrons appropriately.
8+
-->
9+
10+
## Issue
11+
12+
This PR addresses Issue #<issue-number>.
13+
14+
<!-- Fill in any additional notes about the PR here -->
15+
16+
## Check list
17+
18+
### Required
19+
20+
- [ ] I have updated `release-notes/wip-release-notes.md` file
21+
- [ ] I have addressed style warnings given by Visual Studio/ReSharper/Rider
22+
- [ ] I have checked that all tests pass.
23+
24+
### Optional
25+
26+
<!--
27+
Depending on what the PR is for these may not be needed.
28+
If any of these items are not needed, then they can be removed.
29+
-->
30+
31+
- [ ] I have updated the Docs
32+
- [ ] I have updated the `readme.md` file
33+
- [ ] I have updated the files in the docs folder.
34+
- [ ] I have bumped the version number in the `version.txt`
35+
- [ ] I have added or updated any necessary tests.
36+
- [ ] I have ensured that any new code is covered by tests where reasonably possible.

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "nuget"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
time: "14:30"
8+
timezone: "Europe/London"

.github/workflows/build.yml

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
name: Stravaig PROJECT NAME HERE
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
paths-ignore:
8+
- 'README.md'
9+
- 'Example/**'
10+
- '.vscode/**'
11+
- '.gitignore'
12+
- 'contributors.md'
13+
- 'release-notes/**'
14+
- '.github/PULL_REQUEST_TEMPLATE/**'
15+
- 'src/.idea/**'
16+
17+
pull_request:
18+
types: [assigned, opened, synchronize, reopened]
19+
paths-ignore:
20+
- 'README.md'
21+
- 'Example/**'
22+
- '.vscode/**'
23+
- '.gitignore'
24+
25+
workflow_dispatch:
26+
inputs:
27+
isPublic:
28+
description: 'Is Public Release'
29+
required: false
30+
default: "false"
31+
isPreview:
32+
description: 'Is Preview Release'
33+
required: false
34+
default: "true"
35+
36+
jobs:
37+
build:
38+
name: Build, Test, and Release
39+
runs-on: ubuntu-latest
40+
env:
41+
STRAVAIG_SOLUTION: src/XXXX.sln
42+
STRAVAIG_TESTS: XXXX.Tests
43+
STRAVAIG_PROJECT: XXXX
44+
45+
steps:
46+
- name: Check out code
47+
uses: actions/checkout@v3
48+
with:
49+
fetch-depth: 0
50+
51+
- name: Set version number
52+
shell: pwsh
53+
run: ./Set-Version.ps1 -IsPublic "${{ github.event.inputs.isPublic }}" -IsPreview "${{ github.event.inputs.isPreview }}"
54+
55+
- name: Display workflow state
56+
run: |
57+
echo "GITHUB_SHA: $GITHUB_SHA"
58+
echo "Solution: $STRAVAIG_SOLUTION"
59+
echo "Project: $STRAVAIG_PROJECT"
60+
echo "Tests: $STRAVAIG_TESTS"
61+
echo "Package version: $STRAVAIG_PACKAGE_VERSION"
62+
echo "Version Suffix: $STRAVAIG_PACKAGE_VERSION_SUFFIX"
63+
echo "Full Version: $STRAVAIG_PACKAGE_FULL_VERSION"
64+
echo "Publish To NuGet: $STRAVAIG_PUBLISH_TO_NUGET"
65+
echo "Is Preview: $STRAVAIG_IS_PREVIEW"
66+
echo "Is Stable: $STRAVAIG_IS_STABLE"
67+
68+
- uses: actions/setup-dotnet@v3
69+
name: Setup .NET 6.0 and 7.0
70+
with:
71+
dotnet-version: |
72+
6.0.x
73+
7.0.x
74+
75+
- name: .NET State
76+
run: dotnet --info
77+
78+
- name: Build Solution
79+
run: dotnet build $STRAVAIG_SOLUTION --configuration Release
80+
81+
- name: Run Tests
82+
run: dotnet test src/$STRAVAIG_TESTS/$STRAVAIG_TESTS.csproj --configuration Release
83+
84+
- name: Package Preview Release
85+
if: ${{ env.STRAVAIG_IS_PREVIEW == 'true' }}
86+
run: dotnet pack ./src/$STRAVAIG_PROJECT/$STRAVAIG_PROJECT.csproj --configuration Release --output ./out --include-symbols --include-source /p:VersionPrefix="$STRAVAIG_PACKAGE_VERSION" --version-suffix "$STRAVAIG_PACKAGE_VERSION_SUFFIX" -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
87+
88+
- name: Package Stable Release
89+
if: ${{ env.STRAVAIG_IS_STABLE == 'true' }}
90+
run: dotnet pack ./src/$STRAVAIG_PROJECT/$STRAVAIG_PROJECT.csproj --configuration Release --output ./out --include-symbols --include-source /p:VersionPrefix="$STRAVAIG_PACKAGE_VERSION" -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
91+
92+
- name: Push package to NuGet
93+
if: ${{ env.STRAVAIG_PUBLISH_TO_NUGET == 'true' }}
94+
shell: pwsh
95+
run: |
96+
Get-ChildItem ./out/*.nupkg | ForEach-Object {
97+
$name = $_.FullName;
98+
Write-Output "Pushing $name";
99+
dotnet nuget push "$name" --api-key ${{ secrets.STRAVAIG_NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
100+
}
101+
102+
- name: List Contributors
103+
shell: pwsh
104+
run: ./list-contributors.ps1 -HideSummaryAwards
105+
106+
- name: Build Release Notes
107+
shell: pwsh
108+
run: ./build-release-notes.ps1
109+
110+
- name: Archive Simulated Release Information
111+
if: ${{ env.STRAVAIG_PUBLISH_TO_NUGET == 'false' }}
112+
uses: actions/upload-artifact@v3
113+
with:
114+
name: simulated-release-information
115+
path: |
116+
contributors.md
117+
release-notes/full-release-notes.md
118+
release-notes/release-notes-${{ env.STRAVAIG_PACKAGE_FULL_VERSION }}.md
119+
out/**
120+
retention-days: 7
121+
122+
- name: Archive Release Notes
123+
if: ${{ env.STRAVAIG_PUBLISH_TO_NUGET == 'true' }}
124+
uses: actions/upload-artifact@v3
125+
with:
126+
name: release-information
127+
path: |
128+
contributors.md
129+
release-notes/full-release-notes.md
130+
release-notes/release-notes-${{ env.STRAVAIG_PACKAGE_FULL_VERSION }}.md
131+
out/**
132+
133+
- name: Create Release
134+
if: ${{ env.STRAVAIG_PUBLISH_TO_NUGET == 'true' }}
135+
shell: pwsh
136+
env:
137+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
138+
run: |
139+
$assets = @();
140+
$assets += "./out/*.nupkg"
141+
$assets += "./out/*.snupkg"
142+
$assets += "LICENSE"
143+
$assets += "contributors.md"
144+
$assets += "README.md"
145+
$assets += "./release-notes/release-notes-${{ env.STRAVAIG_PACKAGE_FULL_VERSION }}.md"
146+
./Create-Release.ps1 -NotesFile "./release-body.md" -Assets $assets
147+
148+
- name: Bump version
149+
#IF Publishing & Stable release
150+
if: ${{ env.STRAVAIG_PUBLISH_TO_NUGET == 'true' && env.STRAVAIG_IS_STABLE == 'true' }}
151+
shell: pwsh
152+
run: ./Bump-Version.ps1 -BumpPatch
153+
154+
- name: Reset WIP release notes
155+
#IF Publishing & Stable release
156+
if: ${{ env.STRAVAIG_PUBLISH_TO_NUGET == 'true' && env.STRAVAIG_IS_STABLE == 'true' }}
157+
shell: pwsh
158+
run: ./Reset-WipReleaseNotes.ps1
159+
160+
- name: Update Docs
161+
#IF Publishing & Stable release
162+
if: ${{ env.STRAVAIG_PUBLISH_TO_NUGET == 'true' && env.STRAVAIG_IS_STABLE == 'true' }}
163+
shell: pwsh
164+
run: ./Update-Docs.ps1
165+
166+
- name: Commit post release updates
167+
#IF Publishing & Stable release
168+
if: ${{ env.STRAVAIG_PUBLISH_TO_NUGET == 'true' && env.STRAVAIG_IS_STABLE == 'true' }}
169+
uses: EndBug/add-and-commit@v5
170+
with:
171+
add: ./contributors.md ./release-notes/** ./version.txt docs/**
172+
author_name: StravaigBot
173+
author_email: [email protected]
174+
message: "[bot] Post v${{ env.STRAVAIG_PACKAGE_FULL_VERSION }} Release & Bump Version updates."
175+
env:
176+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/gh-pages.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
2+
name: Deploy Docs to GitHubPages
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches:
8+
- "main"
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
20+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
21+
concurrency:
22+
group: "pages"
23+
cancel-in-progress: false
24+
25+
jobs:
26+
# Build job
27+
build:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v3
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Update Docs
36+
shell: pwsh
37+
run: ./Update-Docs.ps1
38+
39+
- name: Setup Pages
40+
uses: actions/configure-pages@v3
41+
42+
- name: Build with Jekyll
43+
uses: actions/jekyll-build-pages@v1
44+
with:
45+
source: ./docs/
46+
destination: ./_site
47+
48+
- name: Upload artifact
49+
uses: actions/upload-pages-artifact@v1
50+
51+
# Deployment job
52+
deploy:
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.deployment.outputs.page_url }}
56+
runs-on: ubuntu-latest
57+
needs: build
58+
steps:
59+
- name: Deploy to GitHub Pages
60+
id: deployment
61+
uses: actions/deploy-pages@v2

0 commit comments

Comments
 (0)