build.sh: build windows/386 and linux/386, update Debian packaging (#193)

* feat(build.sh): build for windows/386

Part of https://github.com/ooni/probe/issues/1315

* fix(build.sh): docker pull so we have latest image

Part of https://github.com/ooni/probe/issues/1315

* fix(build.sh): apk update && apk upgrade to have latest packages

It does not currently seem necessary. But let's be defensive.

Part of https://github.com/ooni/probe/issues/1315.

* fix(windows.yml): for now disable windows/386

It's working locally but not remotely on Windows. We need to
figure out how to install the 386 compiler.

Part of https://github.com/ooni/probe/issues/1315.

* feat(build.sh): build for windows/386

Part of https://github.com/ooni/probe/issues/1315.

* fix(linux.yml): try to enable experimental docker flags

Related to https://github.com/ooni/probe/issues/1315.

See also https://github.com/actions/virtual-environments/issues/368#issuecomment-713588127.

* fix(debian): try to have single workflow with experimental docker

More commits probably needed.

Part of https://github.com/ooni/ooni.org/issues/677.

* remove restriction on the branch name

* maybe we need a pattern also for branches

* less stringent constraints

* consolidated debian workflow into a single workflow

* further fix the debian workflow

* only run debian action for specific branches or tags

* fix(build.sh): package the 386 windows version properly
This commit is contained in:
Simone Basso
2021-01-20 13:09:37 +01:00
committed by GitHub
parent dc6b492986
commit 4b557a0899
11 changed files with 89 additions and 82 deletions
+46
View File
@@ -0,0 +1,46 @@
# Build and publish Debian packages
name: debian
on:
push:
branches:
- "master"
- "release/**"
tags:
- "v*"
jobs:
build:
runs-on: "ubuntu-20.04"
steps:
- name: Docker
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
- uses: actions/setup-go@v1
with:
go-version: "1.14"
- uses: actions/checkout@v2
- run: DOCKER_CLI_EXPERIMENTAL=enabled ./build.sh linux_amd64
- run: sudo apt-get update -q
- run: sudo apt-get build-dep -y --no-install-recommends .
- run: |
VER=$(./CLI/linux/amd64/ooniprobe version)
if [[ ! $GITHUB_REF =~ ^refs/tags/* ]]; then
VER="${VER}~${GITHUB_RUN_NUMBER}"
dch -v $VER "New test version"
BT_REPO="${BT_REPO}-test"
else
dch -v $VER "New release"
fi
dpkg-buildpackage -us -uc -b
find ../ -name "*.deb" -type f
DEB="../ooniprobe-cli_${VER}_amd64.deb"
BT_FNAME="ooniprobe-cli_${VER}_amd64.deb"
curl --upload-file "${DEB}" -u "${BT_APIUSER}:${BT_APIKEY}" \
"https://api.bintray.com/content/${BT_ORG}/${BT_REPO}/${BT_PKGNAME}/${VER}/${BT_FNAME};deb_distribution=${DEBDIST};deb_component=main;deb_architecture=amd64;publish=1"
env:
DEBDIST: unstable
BT_APIKEY: ${{ secrets.BT_APIKEY }}
BT_APIUSER: federicoceratto
BT_ORG: ooni
BT_PKGNAME: ooniprobe
BT_REPO: ooniprobe-debian
@@ -1,37 +0,0 @@
# Build a Debian package only when a relase tag is applied
# and publish it on the public/release archive
name: linux-debian-packages
on:
push:
tags:
- '*'
jobs:
build:
runs-on: "ubuntu-20.04"
steps:
- uses: actions/setup-go@v1
with:
go-version: "1.14"
- uses: actions/checkout@v2
- run: ./build.sh linux
# - run: ./smoketest.sh ./CLI/linux/amd64/ooniprobe
- run: find . -name ooniprobe -type f -executable
- run: sudo apt-get update -q
- run: sudo apt-get build-dep -y --no-install-recommends .
# Use probe version as package version
- run: |
DVER=$(./CLI/linux/amd64/ooniprobe version)
dch -v $DVER "New release"
dpkg-buildpackage -us -uc -b
find ../ -name "*.deb" -type f
DEB="../ooniprobe-cli_${DVER}_amd64.deb"
BT_FNAME="ooniprobe-cli_${DVER}_amd64.deb"
curl --upload-file "${DEB}" -u "${BT_APIUSER}:${BT_APIKEY}" \
"https://api.bintray.com/content/${BT_ORG}/${BT_REPO}/${BT_PKGNAME}/${DVER}/${BT_FNAME};deb_distribution=${DEBDIST};deb_component=main;deb_architecture=amd64;publish=1"
env:
DEBDIST: unstable
BT_APIKEY: ${{ secrets.BT_APIKEY }}
BT_APIUSER: federicoceratto
BT_ORG: ooni
BT_PKGNAME: ooniprobe
BT_REPO: ooniprobe-debian
@@ -1,38 +0,0 @@
# Build a Debian package and publish on a test/internal archive
name: linux-debian-packages
on:
pull_request:
push:
branches:
- master
jobs:
build:
runs-on: "ubuntu-20.04"
steps:
- uses: actions/setup-go@v1
with:
go-version: "1.14"
- uses: actions/checkout@v2
- run: ./build.sh linux
# - run: ./smoketest.sh ./CLI/linux/amd64/ooniprobe
- run: find . -name ooniprobe -type f -executable
- run: sudo apt-get update -q
- run: sudo apt-get build-dep -y --no-install-recommends .
# Use <probe version>~<github build number> as package version
- run: |
VER=$(./CLI/linux/amd64/ooniprobe version)
DVER="${VER}~${GITHUB_RUN_NUMBER}"
dch -v $DVER "test version"
dpkg-buildpackage -us -uc -b
find ../ -name "*.deb" -type f
DEB="../ooniprobe-cli_${DVER}_amd64.deb"
BT_FNAME="ooniprobe-cli_${DVER}_amd64.deb"
curl --upload-file "${DEB}" -u "${BT_APIUSER}:${BT_APIKEY}" \
"https://api.bintray.com/content/${BT_ORG}/${BT_REPO}/${BT_PKGNAME}/${DVER}/${BT_FNAME};deb_distribution=${DEBDIST};deb_component=main;deb_architecture=amd64;publish=1"
env:
DEBDIST: unstable
BT_APIKEY: ${{ secrets.BT_APIKEY }}
BT_APIUSER: federicoceratto
BT_ORG: ooni
BT_PKGNAME: ooniprobe
BT_REPO: ooniprobe-debian-test
+5 -1
View File
@@ -8,11 +8,15 @@ jobs:
build:
runs-on: "ubuntu-latest"
steps:
- name: Docker
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
- uses: actions/setup-go@v1
with:
go-version: "1.14"
- uses: actions/checkout@v2
- run: ./build.sh linux
- run: DOCKER_CLI_EXPERIMENTAL=enabled ./build.sh linux
- run: ./smoketest.sh ./CLI/linux/amd64/ooniprobe
- uses: actions/upload-artifact@v1
with:
+1 -1
View File
@@ -12,7 +12,7 @@ jobs:
with:
go-version: "1.14"
- uses: actions/checkout@v2
- run: bash.exe ./build.sh windows
- run: bash.exe ./build.sh windows_amd64 # TODO(bassosimone): make windows_386 work
- run: bash.exe ./smoketest.sh ./CLI/windows/amd64/ooniprobe.exe
- uses: actions/upload-artifact@v1
with: