forked from dragonflydb/dragonfly
-
Notifications
You must be signed in to change notification settings - Fork 0
169 lines (159 loc) · 5.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
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
name: Version Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
env:
RELEASE_DIR: build-release
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Create Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
omitBody: true
prerelease: true
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
build-qemu:
runs-on: ubuntu-latest
name: Build aarch64 on ubuntu20.04
needs: create-release
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: uraimo/run-on-arch-action@v2
name: Run commands
id: runcmd
with:
arch: aarch64
distro: ubuntu20.04
githubToken: ${{ github.token }}
# Create an artifacts directory
setup: |
mkdir -p "${PWD}/artifacts"
# Mount the artifacts directory as /artifacts in the container
dockerRunArgs: |
--volume "${{ github.workspace }}:/src"
# The shell to run commands with in the container
shell: /bin/bash
install: |
export DEBIAN_FRONTEND=noninteractive
apt update && apt install -q -y autoconf-archive cmake curl git libssl-dev \
libunwind-dev ninja-build libtool gcc-9 g++-9 libboost-context-dev \
zip libzstd-dev debhelper moreutils bison zlib1g-dev
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 40 \
--slave /usr/bin/g++ g++ /usr/bin/g++-9
run: |
# Work around https://github.com/actions/checkout/issues/766
git config --global --add safe.directory /src
cd /src
git describe --always --tags ${{ github.sha }}
if [ -d ${{ env.RELEASE_DIR }} ]; then
chown -R root ${{ env.RELEASE_DIR }}
ls -l ./${{ env.RELEASE_DIR }}
for i in `ls -d ./${{ env.RELEASE_DIR }}/_deps/*-src`; do
git config --global --add safe.directory $(realpath $i)
done
fi
./tools/release.sh
./tools/packaging/generate_debian_package.sh ${{ env.RELEASE_DIR }}/dragonfly-aarch64
mv dragonfly_*.deb ${{ env.RELEASE_DIR }}/
- name: Show the artifact
# Items placed in /src/${{ env.RELEASE_DIR }} in the container will be in
# ${PWD}/${{ env.RELEASE_DIR }} on the host.
run: |
echo finished
ls -al
- name: Upload
uses: actions/upload-artifact@v4
with:
name: dragonfly-aarch64
path: |
${{ env.RELEASE_DIR }}/dragonfly-*tar.gz
${{ env.RELEASE_DIR }}/dragonfly_*.deb
build-native:
runs-on: ubuntu-latest
needs: create-release
strategy:
matrix:
include:
# Build with these flags
- name: debian
container: ubuntu-dev:20
- name: rpm
container: fedora:30
container:
image: ghcr.io/romange/${{ matrix.container }}
options: --security-opt seccomp=unconfined --sysctl "net.ipv6.conf.all.disable_ipv6=0"
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Configure
run: |
if [ -f /etc/redhat-release ]; then
dnf install -y rpm-build libstdc++-static
fi
- name: Build artifacts
timeout-minutes: 25
run: |
# Work around https://github.com/actions/checkout/issues/766
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git describe --always --tags ${{ github.sha }}
./tools/release.sh
# once the build is over, we want to generate a Debian package
if [ -f /etc/debian_version ]; then
./tools/packaging/generate_debian_package.sh ${{ env.RELEASE_DIR }}/dragonfly-x86_64
else
echo "Creating package for ${{github.ref_name}}"
./tools/packaging/rpm/build_rpm.sh ${{ env.RELEASE_DIR }}/dragonfly-x86_64.tar.gz ${{github.ref_name}}
fi
- name: Run regression tests
# Fedora 30 has older python packages, so this fails during requirements installation.
if : matrix.container != 'fedora:30'
uses: ./.github/actions/regression-tests
with:
dfly-executable: dragonfly-x86_64
gspace-secret: ${{ secrets.GSPACES_BOT_DF_BUILD }}
build-folder-name: ${{ env.RELEASE_DIR }}
- name: Save artifacts
run: |
# place all artifacts at the same location
mkdir -p results-artifacts
if [ -f /etc/debian_version ]; then
mv ${{ env.RELEASE_DIR }}/dragonfly-*tar.gz results-artifacts
mv dragonfly_*.deb results-artifacts
else
ls -l *.rpm
mv ./*.rpm ./results-artifacts/
fi
- name: Upload
uses: actions/upload-artifact@v4
with:
name: dragonfly-amd64-${{ matrix.name }}
path: results-artifacts/*
publish_release:
runs-on: ubuntu-latest
needs: [build-native, build-qemu]
steps:
- uses: actions/download-artifact@v4
name: Download files
with:
path: artifacts
- name: See all the artifacts
run: |
ls -lR artifacts/
- uses: ncipollo/release-action@v1
with:
artifacts: "artifacts/dragonfly-*/*"
allowUpdates: true
draft: true
prerelease: true
omitNameDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}