Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Commit

Permalink
chore: add .github
Browse files Browse the repository at this point in the history
  • Loading branch information
futrime committed Mar 28, 2024
1 parent 769ab37 commit 27b198f
Show file tree
Hide file tree
Showing 10 changed files with 189 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

## Checklist before merging

Thank you for your contribution to the repository.
Thank you for your contribution to the repository.
Before submitting this PR, please make sure:

- [ ] Your code builds clean without any errors or warnings
- [ ] Your code follows the code style of [Common C# code conventions](https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions)
- [ ] Your code follows the code style of [Common C# code conventions](https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions) and [JavaScript Standard Style](https://standardjs.com/)
- [ ] You have tested all functions
- [ ] You have not used code without license
- [ ] You have added statement for third-party code
92 changes: 92 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
strategy:
matrix:
runtime:
- linux-arm
- linux-arm64
- ubuntu-x64
- win-arm64
- win-x64
- win-x86
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- run: |
dotnet publish src/EdcHost/EdcHost.csproj -c Release -o bin \
--sc false -r ${{ matrix.runtime }} -p:DebugType=none \
-p:PublishSingleFile=true
- uses: actions/upload-artifact@v3
with:
name: edchost-${{ matrix.runtime }}-${{ github.sha }}
path: bin

check-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- run: dotnet format --verify-no-changes src/EdcHost

- run: dotnet format --verify-no-changes src/EdcHost.Tests

deploy-documentation:
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs: generate-documentation
permissions:
id-token: write
pages: write
runs-on: ubuntu-latest
steps:
- uses: actions/deploy-pages@v2

generate-documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- run: |
mkdir -p site/api/
- uses: docker://asyncapi/github-action-for-generator:2.1.12
with:
filepath: docs/api/asyncapi.yaml
template: '@asyncapi/[email protected]'
output: site/api/

- uses: actions/upload-pages-artifact@v2
with:
path: site/

test:
strategy:
matrix:
runs-on:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4

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

- run: |
dotnet test src/EdcHost.Tests/EdcHost.Tests.csproj
93 changes: 93 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
on:
release:
types:
- published

jobs:
build:
strategy:
matrix:
runtime:
- linux-arm
- linux-arm64
- ubuntu-x64
- win-arm64
- win-x64
- win-x86
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- run: |
dotnet publish src/EdcHost/EdcHost.csproj -c Release -o bin \
--sc false -r ${{ matrix.runtime }} -p:DebugType=none \
-p:PublishSingleFile=true
- run: |
cp CHANGELOG.md LICENSE README.md bin
- uses: actions/upload-artifact@v3
with:
name: edchost-${{ matrix.runtime }}-${{ github.sha }}
path: bin

upload-to-release:
needs:
- build
permissions:
contents: write
runs-on: ubuntu-latest
strategy:
matrix:
runtime:
- linux-arm
- linux-arm64
- ubuntu-x64
- win-arm64
- win-x64
- win-x86
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v3
with:
name: edchost-${{ matrix.runtime }}-${{ github.sha }}
path: bin

- run: |
cp CHANGELOG.md LICENSE README.md bin/
- name: Pack artifact (Windows)
if: startsWith(matrix.runtime, 'win')
run: |
cd bin
zip -r ../edchost-${{ matrix.runtime }}.zip *
cd ..
- name: Pack artifact (Others)
if: startsWith(matrix.runtime, 'win') == false
run: |
cd bin
chmod +x EdcHost
tar -czvf ../edchost-${{ matrix.runtime }}.tar.gz *
cd ..
- name: Upload artifact to release (Windows)
if: startsWith(matrix.runtime, 'win')
uses: softprops/action-gh-release@v1
with:
append_body: true
files: |
edchost-${{ matrix.runtime }}.zip
- name: Upload artifact to release (Others)
if: startsWith(matrix.runtime, 'win') == false
uses: softprops/action-gh-release@v1
with:
append_body: true
files: |
edchost-${{ matrix.runtime }}.tar.gz
4 changes: 2 additions & 2 deletions host/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# EDCHost
# host

The official host program for Electronic Design Competition
Host program for THUEDC25 platform

## Install

Expand Down
24 changes: 0 additions & 24 deletions monitor/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions monitor_3d/.github/workflows/activation.yml

This file was deleted.

41 changes: 0 additions & 41 deletions monitor_3d/.github/workflows/build.yml

This file was deleted.

11 changes: 0 additions & 11 deletions monitor_3d/README.md

This file was deleted.

0 comments on commit 27b198f

Please sign in to comment.