diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 648cf8d..0fffbdf 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -7,19 +7,30 @@ env: NUGET_URL: https://git.claremontmakerspace.org/api/packages/${{ github.repository_owner }}/nuget/index.json jobs: - Build-Chocolatey-Packages: + List-Packages: runs-on: ubuntu-latest container: catthehacker/ubuntu:act-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@v3 + - id: set-matrix + run: echo "matrix=$(find . -name '*.nuspec' -printf '%h\n' | sed 's|^./||g' | jq -Rsc 'split("\n")[:-1]')" >> $GITHUB_OUTPUT + + Build-Chocolatey-Packages: + needs: List-Packages + runs-on: ubuntu-latest + container: catthehacker/ubuntu:act-latest + strategy: + matrix: + package: ${{ fromJson(needs.List-Packages.outputs.matrix) }} steps: - name: Checkout uses: actions/checkout@v3 - name: Chocolatey Pack + run: docker run --rm -v "$PWD/${{ matrix.package }}:/build" -w /build chocolatey/choco choco pack + - name: Chocolatey Push run: | - for package in */ - do - echo "Packing $package" - docker run --rm -v "$PWD/$package:/build" -w /build chocolatey/choco choco pack - docker run --rm -v "$PWD/$package:/build" -w /build chocolatey/choco choco push \ - --source "${{ env.NUGET_URL }}" --key "${{ secrets.GITHUB_TOKEN }}" - done + docker run --rm -v "$PWD/${{ matrix.package }}:/build" -w /build chocolatey/choco choco push \ + --source "${{ env.NUGET_URL }}" --key "${{ secrets.GITHUB_TOKEN }}"