Skip to content

Commit

Permalink
Improve github release workflows (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
ismailsimsek committed Jan 27, 2023
1 parent 064f970 commit 180620a
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 128 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,18 @@ name: Java CI with Maven

on:
push:
branches: [ master ]
branches: [ master, '*.*' ]
paths-ignore:
- '.github/**'
- '.idea/**'
- '.run/**'
pull_request:
branches: [ master ]
branches: [ master, '*.*' ]
paths-ignore:
- '.github/**'
- '.idea/**'
- '.run/**'

env:
SPARK_LOCAL_IP: 127.0.0.1

jobs:
build:

Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/release-ghcr.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/release-latest-ghcr.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/release-latest.yml

This file was deleted.

38 changes: 29 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Create Release

on:
push:
tags:
- '*.*.*.*'
tags: [ '*.*.*.*' ]
branches: [ master ]

env:
SPARK_LOCAL_IP: 127.0.0.1
Expand All @@ -15,18 +15,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
uses: actions/checkout@v3
uses: actions/checkout@v2

- name: Set env
- name: Set env for master(latest) release
if: github.ref_name == 'master'
run: |
echo "RELEASE_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "RELEASE_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo "RELEASE_NAME=latest" >> $GITHUB_ENV
- name: Set env for release
if: github.ref_name != 'master'
run: |
echo "RELEASE_NAME=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Build project
run: mvn -B package -Passembly --file pom.xml -Drevision=${{ env.RELEASE_NAME }}

- name: Delete ${{ env.RELEASE_NAME }} release
- name: Delete previous ${{ env.RELEASE_NAME }} release
uses: dev-drprasad/[email protected]
with:
delete_release: true # default: false
Expand All @@ -45,6 +49,22 @@ jobs:
body: Release ${{ env.RELEASE_NAME }}
draft: false
prerelease: false

files: |
debezium-server-iceberg-sink/target/debezium-server-iceberg-sink-${{ env.RELEASE_NAME }}.jar
debezium-server-iceberg-dist/target/debezium-server-iceberg-dist-${{ env.RELEASE_NAME }}.zip
debezium-server-iceberg-dist/target/debezium-server-iceberg-dist-${{ env.RELEASE_NAME }}.zip
- name: Login to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/build-push-action@v3
name: Build & push Docker image
with:
context: ./
file: ./Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/debezium-server-iceberg:${{ env.RELEASE_NAME }}

0 comments on commit 180620a

Please sign in to comment.