0.0.2 #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Upload new release | |
on: | |
release: | |
types: [published] | |
jobs: | |
build_function: | |
name: Build function | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- run: git fetch --force --tags | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: '1.19' | |
- name: Import GPG key | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@v4 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.PASSPHRASE }} | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v2 | |
with: | |
version: latest | |
args: release --rm-dist | |
env: | |
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
upload_to_buckets: | |
name: Upload to S3 buckets | |
runs-on: ubuntu-latest | |
needs: build_function | |
strategy: | |
matrix: | |
aws_region: | |
- 'us-east-1' | |
- 'us-east-2' | |
- 'us-west-1' | |
- 'us-west-2' | |
- 'eu-central-1' | |
- 'eu-north-1' | |
- 'eu-west-1' | |
- 'eu-west-2' | |
- 'eu-west-3' | |
- 'sa-east-1' | |
- 'ap-northeast-1' | |
- 'ap-northeast-2' | |
- 'ap-northeast-3' | |
- 'ap-south-1' | |
- 'ap-southeast-1' | |
- 'ap-southeast-2' | |
- 'ca-central-1' | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: download zip | |
run: wget -c https://github.com/logzio/firehose-logs/releases/download/${{ github.event.release.tag_name }}/firehose-logs_${{ github.event.release.tag_name }}_linux_amd64.zip -O function.zip | |
- name: create new version | |
run: | | |
cp ./cloudformation/sam-template.yaml ./sam-template-${{ matrix.aws_region }}.yaml | |
sed -i "s/<<VERSION>>/${{ github.event.release.tag_name }}/" "./sam-template-${{ matrix.aws_region }}.yaml" | |
sed -i "s/<<REGION>>/${{ matrix.aws_region }}/" "./sam-template-${{ matrix.aws_region }}.yaml" | |
- name: Upload to aws | |
run: | | |
sudo apt-get update | |
sudo apt-get install awscli | |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY }} | |
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_KEY }} | |
aws configure set region ${{ matrix.aws_region }} | |
aws s3 cp ./sam-template-${{ matrix.aws_region }}.yaml s3://logzio-aws-integrations-${{ matrix.aws_region }}/firehose-logs/${{ github.event.release.tag_name }}/sam-template.yaml --acl public-read | |
aws s3 cp ./function.zip s3://logzio-aws-integrations-${{ matrix.aws_region }}/firehose-logs/${{ github.event.release.tag_name }}/function.zip --acl public-read | |
- name: Clean | |
run: | | |
rm ./sam-template-${{ matrix.aws_region }}.yaml | |
rm ./function.zip |