From 7488aa8ae68f93547ece4aba3a47f028fd975443 Mon Sep 17 00:00:00 2001 From: Lucas Petrino Date: Tue, 18 Mar 2025 13:30:45 +1300 Subject: [PATCH] Fix YAML --- .github/workflows/build.yml | 33 +++++++++----------- .github/workflows/release.yml | 57 +++++++++++++++++------------------ 2 files changed, 41 insertions(+), 49 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da9de3a..b21a170 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,31 +1,26 @@ on: push: branches: - - master + - master pull_request: branches: - - master - + - master jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup dotnet - uses: actions/setup-dotnet@v3 - with: - dotnet-version: '8.0.x' - - - name: Build - run: dotnet build --configuration Release - - - name: Test - run: dotnet test --configuration Release --no-build - - - name: Upload artifacts + - name: Checkout + uses: actions/checkout@v4 + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + - name: Build + run: dotnet build --configuration Release + - name: Test + run: dotnet test --configuration Release --no-build + - name: Upload artifacts uses: actions/upload-artifact@v3 with: name: Build - path: ${{ github.workspace }} \ No newline at end of file + path: ${{ github.workspace }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1728f7a..4ddb89b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,38 +1,35 @@ on: push: tags: - - "v[0-9]+.[0-9]+.[0-9]+" - + - v[0-9]+.[0-9]+.[0-9]+ jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + - name: Verify commit exists in origin/master + run: > + git fetch --no-tags --prune --depth=1 origin + +refs/heads/*:refs/remotes/origin/* - - name: Setup dotnet - uses: actions/setup-dotnet@v3 - with: - dotnet-version: '8.0.x' - - - name: Verify commit exists in origin/master - run: | - git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* - git branch --remote --contains | grep origin/master - - - name: Set VERSION variable from tag - run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV - - - name: Build - run: dotnet build --configuration Release /p:Version=${VERSION} - - - name: Test - run: dotnet test --configuration Release /p:Version=${VERSION} --no-build - - - name: Pack - run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output . - - - name: Push - run: dotnet nuget push CSSUDII.Sodium.Interop.${VERSION}.nupkg --source https://nexus.119.224.65.18.sslip.io/repository/nuget/index.json --api-key ${GITHUB_TOKEN} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + git branch --remote --contains | grep origin/master + - name: Set VERSION variable from tag + run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV + - name: Build + run: dotnet build --configuration Release /p:Version=${VERSION} + - name: Test + run: dotnet test --configuration Release /p:Version=${VERSION} --no-build + - name: Pack + run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build + --output . + - name: Push + run: dotnet nuget push CSSUDII.Sodium.Interop.${VERSION}.nupkg --source + https://nexus.119.224.65.18.sslip.io/repository/nuget/index.json + --api-key ${GITHUB_TOKEN} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}