From f94a31035181e0e1e890961ae385a0b5fd42388d Mon Sep 17 00:00:00 2001 From: VitalickS Date: Wed, 31 Dec 2025 09:30:00 +0000 Subject: [PATCH] Update .gitea /workflows/build-and-test.yml --- .gitea /workflows/build-and-test.yml | 52 ++++++++++++++++++++++++++ .gitea /workflows/build-and-test.yml_ | 26 ------------- 2 files changed, 52 insertions(+), 26 deletions(-) create mode 100644 .gitea /workflows/build-and-test.yml delete mode 100644 .gitea /workflows/build-and-test.yml_ diff --git a/ .gitea /workflows/build-and-test.yml b/ .gitea /workflows/build-and-test.yml new file mode 100644 index 0000000..1697dfd --- /dev/null +++ b/ .gitea /workflows/build-and-test.yml @@ -0,0 +1,52 @@ +--- +kind: pipeline +type: docker +name: publish-nuget + +platform: + os: linux + arch: amd64 + +clone: + depth: full # Needed for versioning if using GitVersion or tags + +steps: + - name: restore + image: mcr.microsoft.com/dotnet/sdk:10.0 + commands: + - cd s8n-runtime + - dotnet restore + + - name: build + image: mcr.microsoft.com/dotnet/sdk:10.0 + commands: + - cd s8n-runtime + - dotnet build --no-restore -c Release + + - name: pack + image: mcr.microsoft.com/dotnet/sdk:10.0 + commands: + - cd s8n-runtime + - dotnet pack --no-build -c Release -o ./nupkg + when: + event: [ tag ] # Only publish on Git tag + # Output: ./s8n-runtime/nupkg/Sharp8N.Runtime.1.0.0.nupkg + + - name: push-to-gitea-nuget + image: mcr.microsoft.com/dotnet/sdk:10.0 + environment: + GITEA_TOKEN: + from_secret: GITEANUGETTOKEN + commands: + - cd s8n-runtime + - | + dotnet nuget push ./nupkg/*.nupkg \ + --api-key $GITEA_TOKEN \ + --source https://code.sharp8n.com/api/packages/Sharp8N/nuget/index.json \ + --skip-duplicate + when: + event: [ tag ] # Only publish on Git tag + +trigger: + tags: + - v* # Optional: only tags like v1.0.0 \ No newline at end of file diff --git a/ .gitea /workflows/build-and-test.yml_ b/ .gitea /workflows/build-and-test.yml_ deleted file mode 100644 index 24fa014..0000000 --- a/ .gitea /workflows/build-and-test.yml_ +++ /dev/null @@ -1,26 +0,0 @@ -name: Build and Test - -run-name: ${{ gitea.actor }} is building Runtime NuGet Package update 🚀 - -on: [push] # Triggers the workflow on push events - -jobs: - build-image: - runs-on: ubuntu-latest # Specifies the runner environment - steps: - - name: Checkout Code - uses: actions/checkout@v4 # Uses a standard action to check out the repository code - - - name: Login to the DockerHub registry - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build Docker image - run: | - docker build -t ${{ vars.DOCKERHUB_IMAGENAME }} . - docker push ${{ vars.DOCKERHUB_IMAGENAME }} - - - name: Run tests (example) - run: docker run --rm ${{ vars.DOCKERHUB_IMAGENAME }}