release jobs
This commit is contained in:
parent
40d85643bb
commit
08e01622d7
16 changed files with 111 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
name: Java CI with Maven
|
||||
name: backend
|
||||
on:
|
||||
push:
|
||||
branches: [ '*' ]
|
31
.github/workflows/charts.yaml
vendored
Normal file
31
.github/workflows/charts.yaml
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
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
|
77
.github/workflows/release.yaml
vendored
Normal file
77
.github/workflows/release.yaml
vendored
Normal file
|
@ -0,0 +1,77 @@
|
|||
name: release
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: |
|
||||
git config user.name github-actions
|
||||
git config user.email github-actions@github.com
|
||||
- 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-
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 1.13
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.13
|
||||
- name: Update development version
|
||||
run: |
|
||||
mvn -q versions:set -DnextSnapshot
|
||||
git add pom.xml **/pom.xml
|
||||
git commit -m "Increased version in pom.xml"
|
||||
git push -f
|
||||
git reset --hard HEAD~1
|
||||
- name: Prepare release
|
||||
id: prep
|
||||
run: |
|
||||
mvn -q versions:set -DremoveSnapshot
|
||||
export VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
|
||||
git add .
|
||||
git commit -m "release ${VERSION}"
|
||||
git tag -f v${VERSION}
|
||||
git push --tags
|
||||
echo ::set-output name=version::${VERSION}
|
||||
- name: Build with Maven
|
||||
run: mvn clean package -Pprod
|
||||
#################
|
||||
# #
|
||||
# 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
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
builder: ${{ steps.buildx.outputs.name }}
|
||||
context: kafka-ui-api
|
||||
push: github.ref == 'refs/heads/master'
|
||||
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
|
|
@ -3,4 +3,5 @@ name: kafka-ui
|
|||
description: A Helm chart for kafka-UI
|
||||
type: application
|
||||
version: 0.0.1
|
||||
appVersion: 0.0.9
|
||||
appVersion: latest
|
||||
icon: https://github.com/provectus/kafka-ui/raw/master/images/kafka-ui-logo.png
|
Loading…
Add table
Reference in a new issue