Improve test helper classes (#511) #267
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Release | |
on: | |
push: | |
tags: [ '*.*.*.*' ] | |
branches: [ master ] | |
env: | |
SPARK_LOCAL_IP: 127.0.0.1 | |
jobs: | |
build-and-release: | |
name: Build and Release | |
if: github.repository_owner == 'memiiso' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
actions: write | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 21 | |
cache: 'maven' | |
- name: Determine Release Name | |
id: set_release_name | |
run: | | |
if [[ "${{ github.ref_name }}" == "master" ]]; then | |
echo "RELEASE_NAME=latest" >> $GITHUB_ENV | |
else | |
echo "RELEASE_NAME=${{ github.ref_name }}" >> $GITHUB_ENV | |
fi | |
shell: bash # Explicitly set shell to bash | |
- name: Build Project | |
run: mvn -B --no-transfer-progress clean package -Passembly --file pom.xml -Drevision=${{ env.RELEASE_NAME }} | |
- name: Delete Existing Release (if any) | |
run: gh release delete ${{ env.RELEASE_NAME }} --cleanup-tag --yes | |
continue-on-error: true | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create GitHub Release | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
name: Release ${{ env.RELEASE_NAME }} | |
tag_name: ${{ env.RELEASE_NAME }} | |
body: Release ${{ env.RELEASE_NAME }} | |
draft: false | |
prerelease: true | |
- name: Delete Maven Package from Github | |
uses: paulushcgcj/delete-github-package@1.0.0 | |
with: | |
type: maven | |
name: io.debezium.debezium-server-iceberg | |
version: ${{ env.RELEASE_NAME }} | |
continue-on-error: true | |
- name: Delete Maven Package Dist from Github | |
uses: paulushcgcj/delete-github-package@1.0.0 | |
with: | |
type: maven | |
name: io.debezium.debezium-server-iceberg-dist | |
version: ${{ env.RELEASE_NAME }} | |
continue-on-error: true | |
- name: Delete Maven Package Sink from Github | |
uses: paulushcgcj/delete-github-package@1.0.0 | |
with: | |
type: maven | |
name: io.debezium.debezium-server-iceberg-sink | |
version: ${{ env.RELEASE_NAME }} | |
continue-on-error: true | |
- name: Publish ${{ env.RELEASE_NAME }} to GitHub Packages | |
run: mvn --batch-mode clean package -Passembly deploy --file pom.xml -Drevision=${{ env.RELEASE_NAME }} -Dmaven.test.skip=true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and Push Docker Image | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./ | |
file: ./Dockerfile | |
push: true | |
tags: ghcr.io/${{ github.repository_owner }}/debezium-server-iceberg:${{ env.RELEASE_NAME }} | |
- name: Delete Untagged Docker Images | |
uses: dylanratcliffe/delete-untagged-containers@main | |
with: | |
package_name: debezium-server-iceberg | |
token: ${{ secrets.GITHUB_TOKEN }} |