Skip to content

Commit

Permalink
feat: add jib based build
Browse files Browse the repository at this point in the history
  • Loading branch information
wurstbrot committed Nov 11, 2023
1 parent d602def commit 861c8fa
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 16 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/buildAndRelease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: buildAndRelease

on:
push:
branches: ["main"]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
with:
branch: 'main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get Semantic Release Version
id: get-version
run: |
echo "::set-output name=version::$(grep -oP '\[\d+\.\d+\.\d+\]' CHANGELOG.md | tr -d '[]')"
- name: show version
run: |
echo "Semantic Release Version: ${{ steps.get-version.outputs.version }}"
- name: setup qemu for multi-arch build
uses: docker/setup-qemu-action@v2
with:
platforms: amd64,arm64
- name: setup buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
#registry: registry.hub.docker.com
username: wurstbrot
password: ${{ secrets.HUB_TOKEN }}
- name: build
run: |
mvn compile com.google.cloud.tools:jib-maven-plugin:2.8.0:build \
-Dimage=docker.io/wurstbrot/metric-analyzer -Djib.to.tags=${{ steps.get-version.outputs.version }},latest
# Commit all changed files back to the repository
- uses: planetscale/ghcommit-action@v0.1.6
with:
commit_message: "🤖 BOT based relase commit"
repo: ${{ github.repository }}
branch: ${{ github.head_ref || github.ref_name }}
env:
GITHUB_TOKEN: ${{secrets.ACCESS_TOKEN}}
16 changes: 0 additions & 16 deletions .github/workflows/version.yaml

This file was deleted.

17 changes: 17 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"branch": "master",
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"releaseRules": [
{"breaking": true, "release": "minor"},
{"tag": "Breaking", "release": "minor"}
]
}
],
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/github"
]
}
Empty file added CHANGELOG.md
Empty file.

0 comments on commit 861c8fa

Please sign in to comment.