-
Notifications
You must be signed in to change notification settings - Fork 11
86 lines (74 loc) · 2.79 KB
/
build-voyager.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
83
84
85
86
name: Create yb-voyager binary
on:
# Trigger on any tag starting with 'yb-voyager/v'
create:
tags:
- "yb-voyager/v*"
# Manual Trigger
workflow_dispatch:
inputs:
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
matrix:
os: [ubuntu-22.04, macos-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.23.1"
- name: Set up Java 17
uses: actions/setup-java@v2
with:
distribution: "temurin"
java-version: 17
- name: Build Binary
run: |
cd yb-voyager
if [ ${{ matrix.os }} == "ubuntu-22.04" ]; then
GOOS=linux GOARCH=amd64 go build -o yb-voyager-linux-amd64
elif [ ${{ matrix.os }} == "macos-latest" ]; then
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -o yb-voyager-darwin-amd64
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -o yb-voyager-darwin-arm64
fi
- name: Build Debezium
run: |
if [ ${{ matrix.os }} == "ubuntu-22.04" ]; then
cd installer_scripts
yes | ./install-yb-voyager --install-from-local-source
cat /tmp/install-yb-voyager.log
fi
- name: Archive the files
run: |
cd yb-voyager
if [ ${{ matrix.os }} == "ubuntu-22.04" ]; then
mkdir voyager-linux-amd64
mv yb-voyager-linux-amd64 voyager-linux-amd64/yb-voyager
cp ./src/srcdb/data/sample-ora2pg.conf voyager-linux-amd64/base-ora2pg.conf
tar -czvf voyager-linux-amd64.tar.gz voyager-linux-amd64
tar -cvzf debezium-server.tar.gz -C /opt/yb-voyager debezium-server
elif [ ${{ matrix.os }} == "macos-latest" ]; then
mkdir voyager-darwin-amd64
mv yb-voyager-darwin-amd64 voyager-darwin-amd64/yb-voyager
cp ./src/srcdb/data/sample-ora2pg.conf voyager-darwin-amd64/base-ora2pg.conf
tar -czvf voyager-darwin-amd64.tar.gz voyager-darwin-amd64
mkdir voyager-darwin-arm64
mv yb-voyager-darwin-arm64 voyager-darwin-arm64/yb-voyager
cp ./src/srcdb/data/sample-ora2pg.conf voyager-darwin-arm64/base-ora2pg.conf
tar -czvf voyager-darwin-arm64.tar.gz voyager-darwin-arm64
fi
- name: Upload Binary to Release
uses: softprops/action-gh-release@v1
with:
files: |
./yb-voyager/voyager-linux-amd64.tar.gz
./yb-voyager/voyager-darwin-amd64.tar.gz
./yb-voyager/voyager-darwin-arm64.tar.gz
./yb-voyager/debezium-server.tar.gz
repo_token: ${{ github.token }}
overwrite: true