Skip to content

Commit

Permalink
chore: update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
soerenschneider committed Sep 27, 2023
1 parent a0c95a7 commit 29d2914
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 5 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
name: golangci-lint

on:
push:
branches:
- master
- main
pull_request:

permissions:
Expand All @@ -15,9 +13,9 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.0

- uses: actions/setup-go@v4.1.0
- uses: actions/setup-go@v4.0.1
with:
go-version: '1.20'
cache: false
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/release-container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write
packages: write

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

name: release

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v3.7.11
name: release
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: simple
package-name: ${{ github.repository }}

- name: Checkout
uses: actions/checkout@v4.1.0
if: ${{ steps.release.outputs.release_created }}

- name: Log in to the container registry
uses: docker/login-action@v2.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: ${{ steps.release.outputs.release_created }}

- name: Extract metadata for container
id: meta
uses: docker/metadata-action@v4.0.1
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}},value=v${{steps.release.outputs.major }}.${{steps.release.outputs.minor }}.${{steps.release.outputs.patch }}
if: ${{ steps.release.outputs.release_created }}

- name: Build and push container image
uses: docker/build-push-action@v3.1.1
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
if: ${{ steps.release.outputs.release_created }}
22 changes: 22 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: test

on:
push:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.0

- uses: actions/setup-go@v4.0.1
with:
go-version: '1.21'

- name: build binary
run: make build

- name: run all tests
run: make tests

0 comments on commit 29d2914

Please sign in to comment.