forked from wal-g/wal-g
-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (118 loc) · 5.1 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
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
name: Release workflow for tagged versions
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v0.2.19, v0.2.14a
env:
GO_VERSION: "1.20"
USE_BROTLI: 1
USE_LIBSODIUM: 1
USE_LZO: 1
jobs:
release-ubuntu:
strategy:
matrix:
os: [ ubuntu-18.04, ubuntu-20.04 ]
db: [ pg, mysql, sqlserver, redis, mongo, fdb, gp ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Install deps
run: sudo apt-get install liblzo2-dev brotli libsodium-dev
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Make deps
run: make deps
- name: Fix LZO (ubuntu-18.04)
if: matrix.os == 'ubuntu-18.04'
run: echo "CGO_LDFLAGS=-no-pie" >> $GITHUB_ENV
- name: Build WAL-G
run: make ${{ matrix.db }}_build
- name: Rename WAL-G binary
run: mv main/${{ matrix.db }}/wal-g wal-g-${{ matrix.db }}-${{ matrix.os }}-amd64
- name: Compress WAL-G binary
run: tar --owner=0 --group=0 -zcvf wal-g-${{ matrix.db }}-${{ matrix.os }}-amd64.tar.gz wal-g-${{ matrix.db }}-${{ matrix.os }}-amd64
- name: Calculate checksum
run: sha256sum wal-g-${{ matrix.db }}-${{ matrix.os }}-amd64 > wal-g-${{ matrix.db }}-${{ matrix.os }}-amd64.sha256
- name: Calculate checksum for the compressed binary
run: sha256sum wal-g-${{ matrix.db }}-${{ matrix.os }}-amd64.tar.gz > wal-g-${{ matrix.db }}-${{ matrix.os }}-amd64.tar.gz.sha256
- name: Upload WAL-G binary
uses: softprops/action-gh-release@v2
with:
files: |
wal-g-${{ matrix.db }}-${{ matrix.os }}-amd64
wal-g-${{ matrix.db }}-${{ matrix.os }}-amd64.tar.gz
wal-g-${{ matrix.db }}-${{ matrix.os }}-amd64.sha256
wal-g-${{ matrix.db }}-${{ matrix.os }}-amd64.tar.gz.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-ubuntu-arm:
runs-on: ubuntu-20.04
strategy:
matrix:
db: [ pg, mysql, sqlserver, redis, mongo, fdb, gp ]
include:
- arch: aarch64
distro: ubuntu20.04
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build on arch
uses: uraimo/run-on-arch-action@v2
with:
arch: ${{ matrix.arch }}
distro: ubuntu20.04
env: |
USE_BROTLI: ${{ env.USE_BROTLI }}
USE_LIBSODIUM: ${{ env.USE_LIBSODIUM }}
USE_LZO: ${{ env.USE_LZO }}
shell: /bin/bash
run: |
apt-get update
apt-get install -y build-essential curl git cmake liblzo2-dev brotli libsodium-dev
curl -LO https://go.dev/dl/go1.20.5.linux-arm64.tar.gz
tar -C /usr/local -xzf go1.20.5.linux-arm64.tar.gz
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
git config --global --add safe.directory /home/runner/work/wal-g/wal-g
git config --global --add safe.directory /home/runner/work/wal-g/wal-g/submodules/brotli
make deps
make ${{ matrix.db }}_build
- name: Rename WAL-G binary
run: mv main/${{ matrix.db }}/wal-g wal-g-${{ matrix.db }}-${{ matrix.distro }}-${{ matrix.arch }}
- name: Compress WAL-G binary
run: tar --owner=0 --group=0 -zcvf wal-g-${{ matrix.db }}-${{ matrix.distro }}-${{ matrix.arch }}.tar.gz wal-g-${{ matrix.db }}-${{ matrix.distro }}-${{ matrix.arch }}
- name: Calculate checksum
run: sha256sum wal-g-${{ matrix.db }}-${{ matrix.distro }}-${{ matrix.arch }} > wal-g-${{ matrix.db }}-${{ matrix.distro }}-${{ matrix.arch }}.sha256
- name: Calculate checksum for the compressed binary
run: sha256sum wal-g-${{ matrix.db }}-${{ matrix.distro }}-${{ matrix.arch }}.tar.gz > wal-g-${{ matrix.db }}-${{ matrix.distro }}-${{ matrix.arch }}.tar.gz.sha256
- name: Upload WAL-G binary
uses: softprops/action-gh-release@v2
with:
files: |
wal-g-${{ matrix.db }}-${{ matrix.distro }}-${{ matrix.arch }}
wal-g-${{ matrix.db }}-${{ matrix.distro }}-${{ matrix.arch }}.tar.gz
wal-g-${{ matrix.db }}-${{ matrix.distro }}-${{ matrix.arch }}.sha256
wal-g-${{ matrix.db }}-${{ matrix.distro }}-${{ matrix.arch }}.tar.gz.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}