Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve github release workflows #167

Merged
merged 1 commit into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}