Skip to content

Commit

Permalink
Merge pull request #2 from dotnet-campus/t/lindexi/ci
Browse files Browse the repository at this point in the history
Add CI for dotnet 6
  • Loading branch information
lindexi authored Dec 13, 2021
2 parents 38f34df + c9d1b0e commit ff79044
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 51 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/dotnet-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ jobs:

runs-on: windows-latest



steps:
- uses: actions/checkout@v1

- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'

- name: Build with dotnet
run: dotnet build --configuration Release

Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/dotnet-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Code format check

on:
push:
branches:
- master
jobs:
dotnet-format:
runs-on: windows-latest
steps:

- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

# 代码文件编码规范机器人,详细请看 [dotnet 在 GitHub 的 Action 上部署自动代码编码规范机器人](https://blog.lindexi.com/post/dotnet-%E5%9C%A8-GitHub-%E7%9A%84-Action-%E4%B8%8A%E9%83%A8%E7%BD%B2%E8%87%AA%E5%8A%A8%E4%BB%A3%E7%A0%81%E7%BC%96%E7%A0%81%E8%A7%84%E8%8C%83%E6%9C%BA%E5%99%A8%E4%BA%BA.html)
- name: Install dotnetCampus.EncodingNormalior
run: dotnet tool update -g dotnetCampus.EncodingNormalior

- name: Fix encoding
run: EncodingNormalior -f . --TryFix true

# 代码格式化机器人,详细请看 [dotnet 基于 dotnet format 的 GitHub Action 自动代码格式化机器人](https://blog.lindexi.com/post/dotnet-%E5%9F%BA%E4%BA%8E-dotnet-format-%E7%9A%84-GitHub-Action-%E8%87%AA%E5%8A%A8%E4%BB%A3%E7%A0%81%E6%A0%BC%E5%BC%8F%E5%8C%96%E6%9C%BA%E5%99%A8%E4%BA%BA.html )
- name: Install dotnet-format
run: dotnet tool install -g dotnet-format

- name: Run dotnet format
run: dotnet format

- name: Commit files
# 下面将使用机器人的账号,你可以替换为你自己的账号
run: |
git config --local user.name "github-actions-dotnet-formatter[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -a -m 'Automated dotnet-format update'
continue-on-error: true

- name: Create Pull Request
# if: steps.format.outputs.has-changes == 'true' # 如果有格式化,才继续
uses: peter-evans/create-pull-request@v3
with:
title: '[Bot] Automated PR to fix formatting errors'
body: |
Automated PR to fix formatting errors
committer: GitHub <[email protected]>
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# 以下是给定代码审查者,需要设置仓库有权限的开发者
assignees: lindexi,walterlv
reviewers: lindexi,walterlv
# 对应的上传分支
branch: t/bot/fix-codeformatting
40 changes: 0 additions & 40 deletions .github/workflows/nuget-master-publish.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/nuget-tag-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:

steps:
- uses: actions/checkout@v1

- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'

- name: Install dotnet tool
run: dotnet tool install -g dotnetCampus.TagToVersion
Expand Down
11 changes: 5 additions & 6 deletions samples/dotnetCampus.LargeAddressAware.Sample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using System;

namespace dotnetCampus.LargeAddressAware.Sample
namespace dotnetCampus.LargeAddressAware.Sample;

internal class Program
{
internal class Program
static void Main(string[] args)
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
Console.WriteLine("Hello World!");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<OutputType>Exe</OutputType>
<TargetFrameworks>net5.0;net48</TargetFrameworks>
<PlatformTarget>x86</PlatformTarget>
<IsPackable>false</IsPackable>
</PropertyGroup>

<Import Project="..\..\src\dotnetCampus.LargeAddressAware\Assets\build\PackageId.targets" />
Expand Down
9 changes: 4 additions & 5 deletions src/dotnetCampus.LargeAddressAware/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
namespace dotnetCampus.LargeAddressAware
namespace dotnetCampus.LargeAddressAware;

internal static class Program
{
internal static class Program
private static void Main()
{
private static void Main()
{
}
}
}
3 changes: 3 additions & 0 deletions src/dotnetCampus.LargeAddressAware/Properties/Global.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
global using System;
global using System.Collections.Generic;
global using System.Text;

0 comments on commit ff79044

Please sign in to comment.