-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 035583d
Showing
10 changed files
with
1,152 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "C# .NET GitHub CLI Ext", | ||
|
||
// For info about the dotnet dev container image see: | ||
// https://github.com/devcontainers/images/blob/main/src/dotnet/README.md | ||
// For a list of tag variants for the dotnet dev container images see: | ||
// https://mcr.microsoft.com/v2/devcontainers/dotnet/tags/list | ||
"image": "mcr.microsoft.com/vscode/devcontainers/dotnet:8.0-bookworm-slim", | ||
|
||
// Configure tool-specific properties. | ||
"customizations": { | ||
|
||
// Configure properties specific to VS Code. | ||
"vscode": { | ||
|
||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"editorconfig.editorconfig", | ||
"github.vscode-github-actions", | ||
"github.copilot", | ||
"github.copilot-chat", | ||
"ms-dotnettools.csdevkit", | ||
"ms-vscode.powershell" | ||
] | ||
} | ||
}, | ||
|
||
// For available dev container features see: | ||
// https://containers.dev/features | ||
"features": { | ||
"ghcr.io/devcontainers/features/github-cli:1": {} | ||
}, | ||
"remoteUser": "vscode" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Normalize line endings to LF for all text files committed into the git repo | ||
# while leaving local line endings untouched in the working tree (local folders). | ||
# This helps avoid problems where contributors don't all have their git config set | ||
# to ensure text files committed use LF line endings. | ||
# See: https://www.aleksandrhovhannisyan.com/blog/crlf-vs-lf-normalizing-line-endings-in-git/ | ||
|
||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: ci/cd | ||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
tags: ["v*"] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: π€ checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: β check format | ||
run: | | ||
dotnet format whitespace --verify-no-changes -v:diag --exclude ~/.nuget | ||
dotnet format style --verify-no-changes -v:diag --exclude ~/.nuget | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: π€ checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: π§ setup-dotnet | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '8.0.x' | ||
dotnet-quality: 'ga' | ||
|
||
- name: π restore | ||
run: dotnet restore -m:1 | ||
|
||
- name: π build | ||
run: dotnet build --no-restore -m:1 | ||
|
||
# - name: π§ͺ test | ||
# run: dotnet test --no-build --no-restore | ||
|
||
- name: π¦ publish (package) artifacts | ||
run: | | ||
dotnet publish src/Extension.csproj -c Release -r win-x64 --self-contained -o bin/win-x64 --no-restore -p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true | ||
dotnet publish src/Extension.csproj -c Release -r osx-x64 --self-contained -o bin/osx-x64 --no-restore -p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true | ||
dotnet publish src/Extension.csproj -c Release -r osx-arm64 --self-contained -o bin/osx-arm64 --no-restore -p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true | ||
dotnet publish src/Extension.csproj -c Release -r linux-x64 --self-contained -o bin/linux-x64 --no-restore -p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true | ||
- name: β‘οΈ stage artifacts | ||
run: | | ||
mkdir -p ${{ runner.temp }}/staging | ||
cp bin/win-x64/gh-sample-ext-csharp.exe ${{ runner.temp }}/staging/sample-ext-csharp-windows-amd64.exe | ||
cp bin/osx-x64/gh-sample-ext-csharp ${{ runner.temp }}/staging/sample-ext-csharp-darwin-amd64 | ||
cp bin/osx-arm64/gh-sample-ext-csharp ${{ runner.temp }}/staging/sample-ext-csharp-darwin-arm64 | ||
cp bin/linux-x64/gh-sample-ext-csharp ${{ runner.temp }}/staging/sample-ext-csharp-linux-amd64 | ||
- name: β¬οΈ upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: executables | ||
path: ${{ runner.temp }}/staging/* | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
permissions: | ||
contents: write | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
|
||
- name: π€ checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: β¬οΈ download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: executables | ||
path: ${{ runner.temp }}/dist | ||
|
||
- name: π create draft release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
draft: true | ||
generate_release_notes: false | ||
fail_on_unmatched_files: true | ||
files: | | ||
${{ runner.temp }}/dist/sample-ext-csharp-windows-amd64.exe | ||
${{ runner.temp }}/dist/sample-ext-csharp-darwin-amd64 | ||
${{ runner.temp }}/dist/sample-ext-csharp-darwin-arm64 | ||
${{ runner.temp }}/dist/sample-ext-csharp-linux-amd64 |
Oops, something went wrong.