From 53d6fbf6f1cc73053fb89103c5f317dc103a4a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=A3=E6=98=8E=E5=BF=97?= Date: Fri, 8 Mar 2024 18:16:21 +0800 Subject: [PATCH] add gitea actions workflow --- .gitea/workflows/main-release.yml | 30 ++++++++++++++++++++++++++++++ .gitea/workflows/testing.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 .gitea/workflows/main-release.yml create mode 100644 .gitea/workflows/testing.yml diff --git a/.gitea/workflows/main-release.yml b/.gitea/workflows/main-release.yml new file mode 100644 index 0000000..e586371 --- /dev/null +++ b/.gitea/workflows/main-release.yml @@ -0,0 +1,30 @@ +name: release +on: + push: + tags: + - "*" + +env: + ASPNETCORE_ENVIRONMENT: Production + +jobs: + release: + name: check and build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # all history for all branches and tags + - name: Setup .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: dotnet restore + run: dotnet restore + - name: dotnet build + run: dotnet build --no-restore -c Release + - name: dotnet publish + run: | + pushd src + dotnet publish --no-build -c Release -o ./publish + popd \ No newline at end of file diff --git a/.gitea/workflows/testing.yml b/.gitea/workflows/testing.yml new file mode 100644 index 0000000..55626d3 --- /dev/null +++ b/.gitea/workflows/testing.yml @@ -0,0 +1,26 @@ +name: testing +on: + - push + - pull_request + +env: + ASPNETCORE_ENVIRONMENT: Production + +jobs: + testing: + name: check and test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # all history for all branches and tags + - name: Setup .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: dotnet restore + run: dotnet restore + - name: dotnet build + run: dotnet build --no-restore -c Release + - name: dotnet test + run: dotnet test --no-build --no-restore -c Release --verbosity normal \ No newline at end of file