This repository has been archived by the owner on Dec 11, 2023. It is now read-only.
Bump github.com/redis/go-redis/v9 from 9.1.0 to 9.3.0 #163
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: Build and Release | |
on: | |
workflow_dispatch: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
pull_request: | |
jobs: | |
build: | |
name: Build binaries | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.19' | |
- name: Go caches | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/go/pkg/mod | |
key: ${{ github.job }}-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ github.job }}-${{ runner.os }}-go- | |
- name: Run build | |
run: make build | |
publish-images: | |
name: Build and publish images | |
if: github.event_name != 'pull_request' | |
runs-on: ubuntu-latest | |
needs: build | |
strategy: | |
fail-fast: false | |
matrix: | |
brokers: [memory-broker, redis-broker] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.19' | |
- name: Go caches | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/go/pkg/mod | |
key: ${{ github.job }}-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ github.job }}-${{ runner.os }}-go- | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GCR | |
uses: docker/login-action@v2 | |
with: | |
registry: gcr.io | |
username: _json_key | |
password: ${{ secrets.GCLOUD_SERVICEACCOUNT_KEY }} | |
- name: GCR metadata | |
id: gcr-meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: gcr.io/triggermesh/${{ matrix.brokers }} | |
tags: | | |
type=semver,pattern={{raw}} | |
type=sha,prefix=,suffix=,format=long | |
- name: Build and push image to gcr.io | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64,linux/ppc64le | |
file: cmd/${{ matrix.brokers }}/Dockerfile | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.gcr-meta.outputs.tags }} | |
labels: ${{ steps.gcr-meta.outputs.labels }} | |
release: | |
name: Create Release | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
needs: publish-images | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.19 | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v4 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
update-tmcore: | |
name: Update TriggerMesh Core | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
needs: release | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Checkout triggermesh/triggermesh-core | |
uses: actions/checkout@v3 | |
with: | |
path: 'tm-core' | |
ref: 'main' | |
repository: 'triggermesh/triggermesh-core' | |
token: ${{ secrets.BOT_TOKEN }} | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.19 | |
- name: Update brokers dependency on tm-core | |
working-directory: tm-core | |
run: | | |
go get github.com/triggermesh/brokers | |
git --no-pager diff | |
- name: Commit and push changes | |
working-directory: tm-core | |
run: | | |
git add -A | |
git status --porcelain | |
if [[ $(git status --porcelain | wc -l) -gt 0 ]]; then | |
git config --global user.name 'TriggerMesh Bot' | |
git config --global user.email '[email protected]' | |
git commit -m "Update brokers dependency to '${GITHUB_REF_NAME}'" | |
git push | |
fi |