Skip to content
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
40 changes: 21 additions & 19 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
name: .NET
name: CI for dotnet

on:
push:
branches: [ "main" ]
branches: ["main"]
paths-ignore:
- 'README.md'
- 'src/SingleOriginSolution/**'
- '.github/**'
- '.vscode/**'
- "README.md"
- "src/SingleOriginSolution/**"
- ".github/**"
- ".vscode/**"
pull_request:
branches: [ "main" ]
branches: ["main"]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: 6.0.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Test
run: dotnet test --no-build --verbosity normal
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Add Publish Artifacts to Release

on:
release:
types: [published]

jobs:
release:
name: Release
strategy:
matrix:
kind: ["windows"]
include:
- kind: windows
os: windows-latest
target: win-x64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup dotnet
uses: actions/setup-dotnet@v3.0.3

- name: Build
shell: bash
run: |
tag=$(git describe --tags --abbrev=0)
release_name="WebDLanding-$tag-${{ matrix.target }}"
# Build everything
dotnet publish src/WebDLanding/WebDLanding.csproj -c Release -o "$release_name"
# Pack files
if [ "${{ matrix.target }}" == "win-x64" ]; then
# Pack to zip for Windows
7z a -tzip "${release_name}.zip" "./${release_name}/*"
else
tar czvf "${release_name}.tar.gz" "$release_name"
fi
# Delete output directory
rm -r "$release_name"
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: "WebDLanding*.zip"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}