Skip to content

Commit

Permalink
Setup GitHub Actions. (#1)
Browse files Browse the repository at this point in the history
Signed-off-by: AraHaan <[email protected]>
  • Loading branch information
AraHaan authored Jul 12, 2022
1 parent 334bcfe commit be6223b
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/dotnet-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: .NET (build)

on:
push:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Install latest .NET 6 SDK.
uses: Elskom/setup-latest-dotnet@main
with:
VERSION_MAJOR: 6
VERSION_BAND: 4xx
- name: Restore, Build, and Pack
uses: Elskom/build-dotnet@main
62 changes: 62 additions & 0 deletions .github/workflows/dotnet-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: .NET (build & publish release)

on:
push:
tags:
- '*'

jobs:
build:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@main
- name: Install latest .NET 6 SDK.
uses: Elskom/setup-latest-dotnet@main
with:
VERSION_MAJOR: 6
VERSION_BAND: 4xx

- name: Restore, Build, and Pack
uses: Elskom/build-dotnet@main
with:
PUSH: false
- name: Clean up temp installer files.
run: |
del artifacts/packages/Release/Shipping/*.wixpdb
del artifacts/packages/Release/Shipping/*-runtime-*.*
del artifacts/packages/Release/Shipping/*-targeting-pack-*.*
shell: pwsh
- name: Upload artifacts
uses: actions/upload-artifact@main
with:
name: Shipping
path: artifacts/packages/Release/Shipping/*
create_release:
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
steps:
# To ensure that the current version being pushed does not get pruned we prune first.
- name: Prune all older versions.
uses: smartsquaregmbh/delete-old-packages@master
with:
keep: 0
names: |
Serilog.Sdk
- name: Download artifacts
uses: actions/download-artifact@main
with:
name: Shipping
path: artifacts/packages/Release/Shipping/
- name: Push nuget Packages to GitHub Packages.
# we must skip the symbol packages.
run: dotnet nuget push **/*.nupkg -s https://nuget.pkg.github.com/${{ github.repository_owner }} -k ${{ secrets.GITHUB_TOKEN }} --skip-duplicate --no-symbols
- uses: ncipollo/release-action@main
with:
artifacts: "artifacts/packages/Release/Shipping/*.exe,artifacts/packages/Release/Shipping/*.*pkg,artifacts/packages/Release/Shipping/*.zip,artifacts/packages/Release/Shipping/*.tar.gz"
token: ${{ secrets.GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: .NET (build pull request)

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Install latest .NET 6 SDK.
uses: Elskom/setup-latest-dotnet@main
with:
VERSION_MAJOR: 6
VERSION_BAND: 4xx
- name: Restore, Build, and Pack
uses: Elskom/build-dotnet@main

0 comments on commit be6223b

Please sign in to comment.