add latest build
This commit is contained in:
parent
36a5bbf9b1
commit
8aa6814e6f
6 changed files with 154 additions and 45 deletions
13
.github/workflows/backend.yml
vendored
13
.github/workflows/backend.yml
vendored
|
@ -1,20 +1,19 @@
|
||||||
name: backend
|
name: backend
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ '*' ]
|
branches:
|
||||||
pull_request:
|
- "**"
|
||||||
branches: [ master ]
|
- "!master"
|
||||||
jobs:
|
jobs:
|
||||||
mvn-all-build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Cache local Maven repository
|
- name: Cache local Maven repository
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository
|
path: ~/.m2/repository
|
||||||
key: ${{ runner.os }}-maven-all-${{ hashFiles('**/pom.xml') }}
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-maven-all-
|
|
||||||
${{ runner.os }}-maven-
|
${{ runner.os }}-maven-
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Set up JDK 1.13
|
- name: Set up JDK 1.13
|
||||||
|
|
31
.github/workflows/charts.yaml
vendored
31
.github/workflows/charts.yaml
vendored
|
@ -1,31 +0,0 @@
|
||||||
name: charts
|
|
||||||
on:
|
|
||||||
create:
|
|
||||||
tags:
|
|
||||||
- "v*.*.*"
|
|
||||||
jobs:
|
|
||||||
release:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- run: |
|
|
||||||
git config user.name github-actions
|
|
||||||
git config user.email github-actions@github.com
|
|
||||||
- uses: azure/setup-helm@v1
|
|
||||||
- name: update appVersion
|
|
||||||
run: |
|
|
||||||
export version=${GITHUB_REF##*/}
|
|
||||||
sed -i "s/appVersion:.*/appVersion: ${version}/" charts/kafka-ui/Chart.yaml
|
|
||||||
- name:
|
|
||||||
run: |
|
|
||||||
export VERSION=${GITHUB_REF##*/}
|
|
||||||
MSG=$(helm package --app-version ${VERSION} charts/kafka-ui)
|
|
||||||
git fetch origin
|
|
||||||
git stash
|
|
||||||
git checkout -b gh-pages origin/gh-pages
|
|
||||||
helm repo index .
|
|
||||||
git add -f ${MSG##*/} index.yaml
|
|
||||||
git commit -m "release ${VERSION}"
|
|
||||||
git push
|
|
6
.github/workflows/frontend.yaml
vendored
6
.github/workflows/frontend.yaml
vendored
|
@ -1,9 +1,9 @@
|
||||||
name: frontend
|
name: frontend
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ '*' ]
|
branches:
|
||||||
pull_request:
|
- "**"
|
||||||
branches: [ master ]
|
- "!master"
|
||||||
jobs:
|
jobs:
|
||||||
npm-test:
|
npm-test:
|
||||||
needs: [mvn-contract-build]
|
needs: [mvn-contract-build]
|
||||||
|
|
60
.github/workflows/latest.yaml
vendored
Normal file
60
.github/workflows/latest.yaml
vendored
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
name: latest
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches: [ "master" ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Cache local Maven repository
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.m2/repository
|
||||||
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-maven-
|
||||||
|
- name: Set up JDK 1.13
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 1.13
|
||||||
|
- name: Build
|
||||||
|
id: build
|
||||||
|
run: |
|
||||||
|
export VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
|
||||||
|
mvn clean package -Pprod -DskipTests
|
||||||
|
#################
|
||||||
|
# #
|
||||||
|
# Docker images #
|
||||||
|
# #
|
||||||
|
#################
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
- name: Cache Docker layers
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: /tmp/.buildx-cache
|
||||||
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-buildx-
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
- name: Build and push
|
||||||
|
id: docker_build_and_push
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
|
context: kafka-ui-api
|
||||||
|
push: true
|
||||||
|
tags: provectuslabs/kafka-ui:latest
|
||||||
|
build-args: |
|
||||||
|
JAR_FILE=kafka-ui-api-${{ steps.build.outputs.version }}.jar
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
21
.github/workflows/release.yaml
vendored
21
.github/workflows/release.yaml
vendored
|
@ -59,19 +59,32 @@ jobs:
|
||||||
${{ runner.os }}-buildx-
|
${{ runner.os }}-buildx-
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
- name: Build and push
|
- name: Build
|
||||||
|
if: github.ref != 'refs/heads/master'
|
||||||
id: docker_build
|
id: docker_build
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
builder: ${{ steps.buildx.outputs.name }}
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
context: kafka-ui-api
|
context: kafka-ui-api
|
||||||
push: github.ref == 'refs/heads/master'
|
push: false
|
||||||
tags: provectuslabs/kafka-ui:${{ steps.prep.outputs.version }}
|
|
||||||
build-args: |
|
build-args: |
|
||||||
JAR_FILE=kafka-ui-api-${{ steps.prep.outputs.version }}.jar
|
JAR_FILE=kafka-ui-api-${{ steps.prep.outputs.version }}.jar
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
- name: Build and push
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
id: docker_build_and_push
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
|
context: kafka-ui-api
|
||||||
|
push: true
|
||||||
|
tags: provectuslabs/kafka-ui:${{ steps.prep.outputs.version }}
|
||||||
|
build-args: |
|
||||||
|
JAR_FILE=kafka-ui-api-${{ steps.prep.outputs.version }}.jar
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
68
.github/workflows/tags.yaml
vendored
Normal file
68
.github/workflows/tags.yaml
vendored
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
name: after_release
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v**"
|
||||||
|
jobs:
|
||||||
|
charts:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
- run: |
|
||||||
|
git config user.name github-actions
|
||||||
|
git config user.email github-actions@github.com
|
||||||
|
- uses: azure/setup-helm@v1
|
||||||
|
- name: update appVersion
|
||||||
|
run: |
|
||||||
|
export version=${GITHUB_REF##*/}
|
||||||
|
sed -i "s/appVersion:.*/appVersion: ${version}/" charts/kafka-ui/Chart.yaml
|
||||||
|
- name:
|
||||||
|
run: |
|
||||||
|
export VERSION=${GITHUB_REF##*/}
|
||||||
|
MSG=$(helm package --app-version ${VERSION} charts/kafka-ui)
|
||||||
|
git fetch origin
|
||||||
|
git stash
|
||||||
|
git checkout -b gh-pages origin/gh-pages
|
||||||
|
helm repo index .
|
||||||
|
git add -f ${MSG##*/} index.yaml
|
||||||
|
git commit -m "release ${VERSION}"
|
||||||
|
git push
|
||||||
|
gh-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- run: |
|
||||||
|
git config user.name github-actions
|
||||||
|
git config user.email github-actions@github.com
|
||||||
|
- id: generate
|
||||||
|
shell: /usr/bin/bash -x -e {0}
|
||||||
|
run: |
|
||||||
|
VERSION=${GITHUB_REF##*/}
|
||||||
|
CHANGELOG=$(git --no-pager log --oneline --pretty=format:"- %s" `git tag --sort=-creatordate | grep '^v.*' | head -n2 | tail -n1`.. | uniq | grep -v '^- Merge\|^- skip')
|
||||||
|
CHANGELOG="${CHANGELOG//'%'/'%25'}"
|
||||||
|
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
|
||||||
|
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
|
||||||
|
echo ${CHANGELOG}
|
||||||
|
echo "::set-output name=changelog::${CHANGELOG}"
|
||||||
|
echo "::set-output name=version::${VERSION}"
|
||||||
|
- id: create_release
|
||||||
|
uses: actions/github-script@v3
|
||||||
|
env:
|
||||||
|
CHANGELOG: ${{steps.generate.outputs.changelog}}
|
||||||
|
VERSION: ${{steps.generate.outputs.version}}
|
||||||
|
with:
|
||||||
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
script: |
|
||||||
|
github.repos.createRelease({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
tag_name: context.ref,
|
||||||
|
name: "Release "+process.env.VERSION,
|
||||||
|
body: process.env.CHANGELOG,
|
||||||
|
draft: false,
|
||||||
|
prerelease: false
|
||||||
|
});
|
Loading…
Add table
Reference in a new issue