-
Notifications
You must be signed in to change notification settings - Fork 44
82 lines (70 loc) · 2.45 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Create Release
on:
push:
tags: [ '*.*.*.*' ]
branches: [ master ]
env:
SPARK_LOCAL_IP: 127.0.0.1
jobs:
build:
name: Main
if: github.repository_owner == 'memiiso'
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
cache: 'maven'
- name: Set env for master(latest) release
if: github.ref_name == 'master'
run: |
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 --no-transfer-progress package -Passembly --file pom.xml -Drevision=${{ env.RELEASE_NAME }}
- name: Delete previous ${{ env.RELEASE_NAME }} release
uses: dev-drprasad/delete-tag-and-release@v1.1
with:
delete_release: true
tag_name: ${{ env.RELEASE_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 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
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
- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
name: Build & push Docker image
with:
context: ./
file: ./Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/debezium-server-iceberg:${{ env.RELEASE_NAME }}
- name: Delete all containers from repository without tags
uses: dylanratcliffe/delete-untagged-containers@main
with:
package_name: debezium-server-iceberg
token: ${{ secrets.GITHUB_TOKEN }}