-
Notifications
You must be signed in to change notification settings - Fork 1
220 lines (215 loc) · 11 KB
/
ci-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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
name: Build binaries for linux/macos/windows
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '[0-9]+.[0-9]+.[0-9]+'
permissions:
contents: write
jobs:
linux:
runs-on: ubuntu-latest
#if: "!contains(github.event.head_commit.message, '[skip_build]')"
steps:
- uses: actions/checkout@v2
- name: Extract branch name
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/tags/})" >> "$GITHUB_OUTPUT"
#run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/tags/})"
id: extract_branch
- name: Build
run: |
docker build -f Dockerfile -t temp/sqloci:1.0 .
cd /tmp && mkdir bin
cd /tmp/bin
mkdir bin_with_orcl bin_wo bin_with_orcl_wver bin_wo_wver
docker create -ti --name sqloci temp/sqloci:1.0 bash
docker cp sqloci:/root/go/src/sqldiffer/bin_with_orcl/schema_gen bin_with_orcl/
docker cp sqloci:/root/go/src/sqldiffer/bin_with_orcl/diff_gen bin_with_orcl/
docker cp sqloci:/root/go/src/sqldiffer/bin_wo/schema_gen bin_wo/
docker cp sqloci:/root/go/src/sqldiffer/bin_wo/diff_gen bin_wo/
docker cp sqloci:/root/go/src/sqldiffer/bin_with_orcl_wver/schema_gen.exe bin_with_orcl_wver/
docker cp sqloci:/root/go/src/sqldiffer/bin_with_orcl_wver/diff_gen.exe bin_with_orcl_wver/
docker cp sqloci:/root/go/src/sqldiffer/bin_wo_wver/schema_gen.exe bin_wo_wver/
docker cp sqloci:/root/go/src/sqldiffer/bin_wo_wver/diff_gen.exe bin_wo_wver/
ls -ltr /tmp/bin/bin_with_orcl
cd /tmp/bin/bin_with_orcl
zip -r sqldiffer_${{ steps.extract_branch.outputs.branch }}_withorcl_linux-x86_64.zip schema_gen diff_gen
unzip -l /tmp/bin/bin_with_orcl/sqldiffer_${{ steps.extract_branch.outputs.branch }}_withorcl_linux-x86_64.zip
ls -ltr /tmp/bin/bin_wo
cd /tmp/bin/bin_wo
zip -r sqldiffer_${{ steps.extract_branch.outputs.branch }}_linux-x86_64.zip schema_gen diff_gen
unzip -l /tmp/bin/bin_wo/sqldiffer_${{ steps.extract_branch.outputs.branch }}_linux-x86_64.zip
ls -ltr /tmp/bin/bin_with_orcl_wver
cd /tmp/bin/bin_with_orcl_wver
zip -r sqldiffer_${{ steps.extract_branch.outputs.branch }}_withorcl_win.zip schema_gen.exe diff_gen.exe
unzip -l /tmp/bin/bin_with_orcl_wver/sqldiffer_${{ steps.extract_branch.outputs.branch }}_withorcl_win.zip
ls -ltr /tmp/bin/bin_wo_wver
cd /tmp/bin/bin_wo_wver
zip -r sqldiffer_${{ steps.extract_branch.outputs.branch }}_win.zip schema_gen.exe diff_gen.exe
unzip -l /tmp/bin/bin_wo_wver/sqldiffer_${{ steps.extract_branch.outputs.branch }}_win.zip
- name: Create Release
uses: elgohr/Github-Release-Action@v5
id: create_release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: false
prerelease: false
release_name: Release ${{ steps.extract_branch.outputs.branch }}
title: Release ${{ steps.extract_branch.outputs.branch }}
tag_name: ${{ github.ref }}
- name: upload linux artifact no oracle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /tmp/bin/bin_wo/sqldiffer_${{ steps.extract_branch.outputs.branch }}_linux-x86_64.zip
asset_name: sqldiffer_${{ steps.extract_branch.outputs.branch }}_linux-x86_64.zip
asset_content_type: application/gzip
- name: upload windows artifact no oracle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /tmp/bin/bin_wo_wver/sqldiffer_${{ steps.extract_branch.outputs.branch }}_win.zip
asset_name: sqldiffer_${{ steps.extract_branch.outputs.branch }}_win.zip
asset_content_type: application/gzip
- name: upload linux artifact with oracle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /tmp/bin/bin_with_orcl/sqldiffer_${{ steps.extract_branch.outputs.branch }}_withorcl_linux-x86_64.zip
asset_name: sqldiffer_${{ steps.extract_branch.outputs.branch }}_withorcl_linux-x86_64.zip
asset_content_type: application/gzip
- name: upload windows artifact with oracle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /tmp/bin/bin_with_orcl_wver/sqldiffer_${{ steps.extract_branch.outputs.branch }}_withorcl_win.zip
asset_name: sqldiffer_${{ steps.extract_branch.outputs.branch }}_withorcl_win.zip
asset_content_type: application/gzip
macos_intel:
runs-on: ${{ matrix.os }}
needs: linux
#if: "!contains(github.event.head_commit.message, '[skip_build]')"
strategy:
matrix:
os: [macOS-13]
steps:
- uses: actions/checkout@v2
- name: Install deps
run: |
#brew install docker
#export PATH=/opt/homebrew/bin:${PATH}
#arch -arm64 brew install lima
#brew install colima
#colima start
#colima start --cpu 2 --memory 4 --disk 50 --arch x86_64
brew install go pkg-config protobuf protoc-gen-go
- name: Build
run: |
pushd /tmp
wget -q https://download.oracle.com/otn_software/mac/instantclient/198000/instantclient-basic-macos.x64-19.8.0.0.0dbru.dmg
wget -q https://download.oracle.com/otn_software/mac/instantclient/198000/instantclient-sdk-macos.x64-19.8.0.0.0dbru.dmg
sudo hdiutil attach instantclient-basic-macos.x64-19.8.0.0.0dbru.dmg
sudo hdiutil attach instantclient-sdk-macos.x64-19.8.0.0.0dbru.dmg
cd /Volumes/instantclient-basic-macos.x64-19.8.0.0.0dbru
./install_ic.sh
cd /Volumes/instantclient-sdk-macos.x64-19.8.0.0.0dbru
./install_ic.sh
popd
cp oci8-macos.pc /Users/runner/Downloads/instantclient_19_8/oci8.pc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/Users/runner/Downloads/instantclient_19_8
export PKG_CONFIG_PATH=/Users/runner/Downloads/instantclient_19_8
make all
ls -ltr bin/
mkdir /tmp/bin
cd bin && zip -r sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_withorcl_macosx_intel.zip * && cp sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_withorcl_macosx_intel.zip /tmp/bin/
unzip -l /tmp/bin/sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_withorcl_macosx_intel.zip
cd ..
rm -rf bin
make all_wo_orcl
ls -ltr bin/
cd bin && zip -r sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_macosx_intel.zip * && cp sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_macosx_intel.zip /tmp/bin/
unzip -l /tmp/bin/sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_macosx_intel.zip
- name: upload darwin-intel artifact no oracle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.linux.create_release.outputs.upload_url }}
asset_path: /tmp/bin/sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_macosx_intel.zip
asset_name: sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_macosx_intel.zip
asset_content_type: application/gzip
- name: upload darwin-intel artifact with oracle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.linux.create_release.outputs.upload_url }}
asset_path: /tmp/bin/sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_withorcl_macosx_intel.zip
asset_name: sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_withorcl_macosx_intel.zip
asset_content_type: application/gzip
macos_arm:
runs-on: ${{ matrix.os }}
needs: linux
#if: "!contains(github.event.head_commit.message, '[skip_build]')"
strategy:
matrix:
os: [macos-latest]
steps:
- uses: actions/checkout@v2
- name: Build
run: |
brew install go pkg-config protobuf protoc-gen-go
pushd /tmp
wget -q https://download.oracle.com/otn_software/mac/instantclient/198000/instantclient-basic-macos.x64-19.8.0.0.0dbru.dmg
wget -q https://download.oracle.com/otn_software/mac/instantclient/198000/instantclient-sdk-macos.x64-19.8.0.0.0dbru.dmg
sudo hdiutil attach instantclient-basic-macos.x64-19.8.0.0.0dbru.dmg
sudo hdiutil attach instantclient-sdk-macos.x64-19.8.0.0.0dbru.dmg
cd /Volumes/instantclient-basic-macos.x64-19.8.0.0.0dbru
./install_ic.sh
cd /Volumes/instantclient-sdk-macos.x64-19.8.0.0.0dbru
./install_ic.sh
popd
cp oci8-macos.pc /Users/runner/Downloads/instantclient_19_8/oci8.pc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/Users/runner/Downloads/instantclient_19_8
export PKG_CONFIG_PATH=/Users/runner/Downloads/instantclient_19_8
make all
docker build -f Dockerfile -t temp/sqloci:1.0 .
ls -ltr bin/
mkdir /tmp/bin
cd bin && zip -r sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_withorcl_macosx_arm.zip * && cp sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_withorcl_macosx_arm.zip /tmp/bin/
unzip -l /tmp/bin/sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_withorcl_macosx_arm.zip
cd ..
rm -rf bin
make all_wo_orcl
ls -ltr bin/
cd bin && zip -r sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_macosx_arm.zip * && cp sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_macosx_arm.zip /tmp/bin/
unzip -l /tmp/bin/sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_macosx_arm.zip
- name: upload darwin-arm artifact no oracle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.linux.create_release.outputs.upload_url }}
asset_path: /tmp/bin/sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_macosx_arm.zip
asset_name: sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_macosx_arm.zip
asset_content_type: application/gzip
- name: upload darwin-arm artifact with oracle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.linux.create_release.outputs.upload_url }}
asset_path: /tmp/bin/sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_withorcl_macosx_arm.zip
asset_name: sqldiffer_${{ needs.linux.extract_branch.outputs.branch }}_withorcl_macosx_arm.zip
asset_content_type: application/gzip