Skip to content

Create yb-voyager binary #892

Create yb-voyager binary

Create yb-voyager binary #892

Workflow file for this run

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-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
- 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-latest" ]; 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-latest" ]; 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-latest" ]; 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