From 4f1af4c9a34121a9df23a4eb5e4bcc7b6d925302 Mon Sep 17 00:00:00 2001 From: Marco Pfatschbacher Date: Mon, 11 Dec 2023 17:24:33 +0000 Subject: [PATCH] add release steps --- .github/shared/docker-chocolatey/action.yml | 5 +++++ .github/workflows/pr-build.yml | 23 ++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/shared/docker-chocolatey/action.yml b/.github/shared/docker-chocolatey/action.yml index cae2fd5..16466bb 100644 --- a/.github/shared/docker-chocolatey/action.yml +++ b/.github/shared/docker-chocolatey/action.yml @@ -6,10 +6,15 @@ inputs: command: description: 'The command to exec' required: true + jsonEnv: + description: 'Environment to pass to docker run as json string' + required: false + default: "{}" runs: using: 'docker' image: 'Dockerfile' + env: ${{ fromJSON(inputs.jsonEnv) }} args: - ${{ inputs.command }} diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index e3926ba..75ae17f 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -78,4 +78,25 @@ jobs: name: sidecar-artifacts retention-days: 14 path: | - dist/pkg \ No newline at end of file + dist/pkg + + - name: Chocolatey Push + if: startsWith(github.ref, 'refs/tags/') + uses: ./.github/shared/docker-chocolatey + with: + command: make push-chocolatey + jsonEnv: '{ "CHOCO_API_KEY": "${{ secrets.CHOCO_API_KEY }}" }' + + - name: "Upload sidecar artifacts to S3" + if: startsWith(github.ref, 'refs/tags/') + env: + AWS_DEFAULT_REGION: "eu-west-1" + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_SIDECAR_RELEASES_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SIDECAR_RELEASES_SECRET_KEY }} + run: | + aws s3 cp --no-progress --recursive dist/pkg s3://graylog2-releases/graylog-collector-sidecar/${{ github.ref_name }}/ + + - name: "Releasing to Github" + if: startsWith(github.ref, 'refs/tags/') + run: | + gh release create ${{ github.ref_name }} --draft --notes "Insert changes here." dist/pkg/*