ooni-probe-cli/.github/workflows/debian.yml
Simone Basso 3109d56aef
feat(gha): build debian package using ./make (#331)
Part of https://github.com/ooni/probe/issues/1466. We're building both `arm64` and `amd64`. We are still not publishing `arm64` packages, which is what is asked in the original issue, but we're really close to doing that.
2021-05-06 22:13:09 +02:00

53 lines
1.8 KiB
YAML

---
# 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.16"
- uses: actions/checkout@v2
- run: DOCKER_CLI_EXPERIMENTAL=enabled ./build.sh linux_amd64
- run: mkdir -p debian/bin
- run: cp ./CLI/linux/amd64/ooniprobe debian/bin/ooniprobe
- run: sudo apt-get update -q
- run: sudo apt-get build-dep -y --no-install-recommends .
- name: Install deps
run: sudo apt-get install -y --no-install-recommends git python3 python3-requests python3-gnupg s3cmd
- name: Sign and upload
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"
echo no | sudo dpkg -i $DEB
export DEBFNAME="ooniprobe-cli_${VER}_amd64.deb"
cd $GITHUB_WORKSPACE
# AWS user debci-s3
./.github/workflows/debops-ci --show-commands upload --bucket-name ooni-deb $DEB
env:
DEB_GPG_KEY: ${{ secrets.DEB_GPG_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
BT_REPO: ooniprobe-debian