From 8842741304f0a27305c61ce40dc61fe64a28650f Mon Sep 17 00:00:00 2001 From: Alan Rynne Date: Tue, 28 May 2024 13:43:27 +0200 Subject: [PATCH] ci: Further specified CI and release workflows --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++-------- .github/workflows/main.yml | 6 ++---- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df81ef3f0e..336a0e0ff3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,8 @@ name: .NET Build on: pull_request: - branches: ["main"] + branches: + - "*" jobs: build-and-publish: @@ -11,6 +12,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Setup .NET uses: actions/setup-dotnet@v4 @@ -21,16 +24,28 @@ jobs: uses: actions/cache@v4 with: path: ~/.nuget/packages - key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} - - - name: Format - run: ./build.ps1 format + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} - - name: Restore - run: ./build.ps1 restore + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v1.1.1 + with: + versionSpec: "5.x" - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v2 - - name: Build + - name: Determine Version + id: version + uses: gittools/actions/gitversion/execute@v1.1.1 + + - name: 🗄️ Format + run: ./build.ps1 format + + - name: ♻️ Restore + run: ./build.ps1 restore + + - name: ⚒️ Build run: ./build.ps1 build + env: + VERSION: ${{ env.fullSemVer }} + FILE_VERSION: ${{ env.assemblySemFileVer }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9635494fbb..4cc4f7a807 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,10 +2,8 @@ name: .NET Build and Publish on: push: - branches: ["main", "dev", "dui3/alpha"] - pull_request: - branches: - - dui3/alpha + branches: ["main", "dev", "dui3/alpha", "dui3/ci/*"] + tags: ["3.*"] jobs: build-and-publish: