Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add git action #1

Merged
merged 7 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Description

[Description of the bug or feature]

### Steps to Reproduce

1.
2.

### Related code

```
insert short code snippets here
```

**Expected behavior:** [What you expected to happen]

**Actual behavior:** [What actually happened]



## Specifications

- .NET Version : 6.0.0
- System : CentOS 7.2
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build

on:
push:
branches: [ dev, main, master, '**' ]
pull_request:
branches: [ dev, main, master ]

jobs:

windows:
name: build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest ]

steps:
- uses: actions/checkout@v2
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x

- name: Show dotnet Version
run: |
dotnet --list-sdks
dotnet --list-runtimes

- name: Build with dotnet
run: |
dotnet build --configuration Release D:\a\Dispose.Scope\Dispose.Scope\DisposeScope.sln
37 changes: 37 additions & 0 deletions .github/workflows/buildandtest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build&Test

on:
push:
branches: [ dev, main, master, '**' ]
pull_request:
branches: [ dev, main, master ]

jobs:

linux:
name: build and test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]

steps:
- uses: actions/checkout@v2
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x

- name: Show dotnet Version
run: |
dotnet --list-sdks
dotnet --list-runtimes

- name: Build with dotnet
run: |
dotnet build --configuration Release /home/runner/work/Dispose.Scope/Dispose.Scope/DisposeScope.sln

- name: Run tests
run: |
dotnet test /home/runner/work/Dispose.Scope/Dispose.Scope/tests/Dispose.Scope.Tests/Dispose.Scope.Tests.csproj
50 changes: 50 additions & 0 deletions .github/workflows/release_stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release_Stable

on:
push:
tags:
- "*.*.*-beta*"
- "*.*.*-rc*"

jobs:
build_artifact:
name: Build and upload artifact
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
- name: Build with dotnet
run: dotnet build --configuration Release /home/runner/work/Dispose.Scope/Dispose.Scope/DisposeScope.sln
- name: Pack with dotnet
env:
VERSION: ${{ github.ref_name }}
run: dotnet pack /home/runner/work/Dispose.Scope/Dispose.Scope/DisposeScope.sln --version-suffix $VERSION -o /home/runner/work/nugetpkgs -c Release --no-build
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: nugetpkgs
path: /home/runner/work/nugetpkgs

release_nuget:
name: Release to Nuget
needs: build_artifact
runs-on: ubuntu-latest

steps:
- name: Download build artifacts
uses: actions/download-artifact@v1
with:
name: nugetpkgs
- name: list nugetpkgs
run: ls nugetpkgs
- name: Release
run: |
for file in nugetpkgs/*.nupkg
do
dotnet nuget push $file -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate -s https://www.nuget.org/api/v2/package
done
51 changes: 51 additions & 0 deletions .github/workflows/release_unstable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release_Unstable

on:
push:
tags:
- "*.*.*"
- "!*.*.*-beta*"
- "!*.*.*-rc*"

jobs:
build_artifact:
name: Build and upload artifact
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
- name: Build with dotnet
run: dotnet build --configuration Release /home/runner/work/Dispose.Scope/Dispose.Scope/DisposeScope.sln
- name: Pack with dotnet
env:
VERSION: ${{ github.ref_name }}
run: dotnet pack /home/runner/work/Dispose.Scope/Dispose.Scope/DisposeScope.sln --version-suffix $VERSION -o /home/runner/work/nugetpkgs -c Release --no-build
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: nugetpkgs
path: /home/runner/work/nugetpkgs

release_nuget:
name: Release to Nuget
needs: build_artifact
runs-on: ubuntu-latest

steps:
- name: Download build artifacts
uses: actions/download-artifact@v1
with:
name: nugetpkgs
- name: list nugetpkgs
run: ls nugetpkgs
- name: Release
run: |
for file in nugetpkgs/*.nupkg
do
dotnet nuget push $file -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate -s https://www.nuget.org/api/v2/package
done
2 changes: 1 addition & 1 deletion DisposeScope.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dispose.Scope", "src\Dispose.Scope\Dispose.Scope.csproj", "{B976AB15-A442-440D-A5C1-FC19D1DDE964}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample", "Samples\Sample\Sample.csproj", "{0A12AE66-2DA0-4C07-879D-5A09E01E43CF}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample", "samples\Sample\Sample.csproj", "{0A12AE66-2DA0-4C07-879D-5A09E01E43CF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmark", "benchmarks\Benchmark\Benchmark.csproj", "{58CA15BC-A843-4013-B2F4-9D582F7827FC}"
EndProject
Expand Down
Loading