From cfc63db4c5d825cb4836c4eff147a485642039f8 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 25 Mar 2023 15:28:06 -0400 Subject: [PATCH] ci: Add automatic build action --- .gitea/workflows/build.yml | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .gitea/workflows/build.yml diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..7980ecd --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,41 @@ +on: + push: + branches: + - main + +env: + NUGET_URL: https://git.claremontmakerspace.org/api/packages/${{ github.repository_owner }}/nuget/index.json + +jobs: + Build-Chocolatey-Packages: + runs-on: ubuntu-latest + container: catthehacker/ubuntu:act-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup dotnet + uses: https://github.com/actions/setup-dotnet@v3 + with: + dotnet-version: 7 + - name: Chocolatey Pack + uses: docker://chocolatey/choco:latest + with: + args: | + sh -c 'for package in */ + do + ( + cd "$package" + echo "Packing $package" + choco pack --no-color + ) + done' + - name: Nuget Push + run: | + for package in */*.nupkg + do + echo "Pushing $package" + dotnet nuget push --source $NUGET_URL --api-key "${{ secrets.REGISTRY_TOKEN }}" "$package" --skip-duplicate + done + env: + DOTNET_CLI_TELEMETRY_OPTOUT: "true"