From 723ce9709af08228744a1ab62271eb05e3645ca4 Mon Sep 17 00:00:00 2001 From: Oguzhan Kiyar Date: Mon, 8 Jan 2024 22:31:17 +0300 Subject: [PATCH] chore: setup check and release workflows --- .github/workflows/check.yml | 33 ++++++++++++++++++++ .github/workflows/release.yml | 58 +++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 .github/workflows/check.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..218e442 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,33 @@ +name: Build & Test + +on: + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-20.04 + name: Build & Test + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '5.0.x' + + - name: Build + env: + SOLUTIONFILE: FiltexNet.sln + VERSION: 1.0.0 + run: | + bash ./scripts/build.sh + + - name: Test + env: + SOLUTIONFILE: FiltexNet.sln + run: | + bash ./scripts/test.sh \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..19735b3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,58 @@ +name: Build & Release + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-20.04 + name: Build & Release + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '5.0.x' + + - name: Get version + id: vars + run: | + bash ./scripts/version.sh + echo "version=$(cat version.txt)" >> $GITHUB_OUTPUT + + - name: Build + env: + SOLUTIONFILE: FiltexNet.sln + VERSION: ${{ steps.vars.outputs.version }} + run: | + bash ./scripts/build.sh + + - name: Test + env: + SOLUTIONFILE: FiltexNet.sln + run: | + bash ./scripts/test.sh + + - name: Create release + uses: actions/create-release@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: "v${{ steps.vars.outputs.version }}" + release_name: "v${{ steps.vars.outputs.version }}" + draft: false + prerelease: false + + - name: Pack + env: + NUGET_SOURCE: https://api.nuget.org/v3/index.json + NUGET_KEY: ${{ secrets.NUGET_API_KEY }} + VERSION: ${{ steps.vars.outputs.version }} + run: | + bash ./scripts/pack.sh \ No newline at end of file