Skip to content

Commit

Permalink
Manually create release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zhicwu authored Dec 16, 2020
1 parent 15f6251 commit 15c84a1
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Release

on:
workflow_dispatch:
inputs:
major:
description: "Major version"
required: true
default: "2"
minor:
description: "Minor version"
required: false
default: "0"
patch:
description: "Patch"
required: false
default: "0"
organization:
description: "DockerHub organization"
required: false
default: "yandex"

jobs:
pre-release:
name: "Pre Release"
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn -Dmaven.test.skip=true -Drevision=${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.patch }} --batch-mode -Prelease package
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "v${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.patch }}"
prerelease: true
title: "Release v${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.patch }}"
files: |
LICENSE
NOTICE
target/clickhouse*.jar
target/*.deb
target/**/*.rpm
publish:
name: "Build and Publish Docker Image"
runs-on: ubuntu-latest
needs: pre-release
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWD }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
build-args: |
revision=${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.patch }}
repository=${{ github.repository }}
tags: |
${{ github.event.inputs.organization }}/clickhouse-jdbc-bridge:latest
${{ github.event.inputs.organization }}/clickhouse-jdbc-bridge:${{ github.event.inputs.major }}
${{ github.event.inputs.organization }}/clickhouse-jdbc-bridge:${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}
${{ github.event.inputs.organization }}/clickhouse-jdbc-bridge:${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.patch }}

0 comments on commit 15c84a1

Please sign in to comment.