Skip to content

Commit

Permalink
feature: add github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
asser-dk committed Jan 26, 2024
1 parent d8eb642 commit 2081975
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/dotnet-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: .NET continuous build and test

on:
push:
branches:
- '*'
paths:
- 'src/**'
- 'test/**'
- 'examples/**'
- '*.sln'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Pack OneOf.Extensions.Blazor
run: dotnet pack src/OneOf.Extensions.Blazor/ -c Release -o ./artifacts --include-source --verbosity minimal -p:PackageVersion=0.1.${{ github.run_number }}-alpha
- name: Push to nuget.org
run: dotnet nuget push ./artifacts/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.NUGET_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/release-created.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: On Release Created

on:
release:
types: [created]

jobs:
build_prelease_nuget_package:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Pack OneOf.Extensions.Blazor
run: dotnet pack src/OneOf.Extensions.Blazor/ -c Release -o ./artifacts --include-source --verbosity minimal -p:PackageVersion=${{ github.event.release.tag_name }}-${{ github.run_number }}-rc
- name: Push to nuget.org
run: dotnet nuget push ./artifacts/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.NUGET_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
with:
release-type: simple
27 changes: 27 additions & 0 deletions .github/workflows/release-published.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: .NET Publish

on:
release:
types: [ published ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore --configuration Release --verbosity minimal
- name: Build
run: dotnet build --configuration Release --no-restore --verbosity minimal
- name: Test
run: dotnet test --configuration Release --no-build --verbosity minimal
- name: Pack OneOf.Extensions.Blazor
run: dotnet pack src/OneOf.Extensions.Blazor/ -c Release -o ./artifacts --include-source --verbosity minimal -p:PackageVersion=${{ github.event.release.tag_name }}
- name: Push to nuget.org
run: dotnet nuget push ./artifacts/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.NUGET_TOKEN }}

0 comments on commit 2081975

Please sign in to comment.