2021-10-22 16:13:44 +02:00
|
|
|
# oohelperd builds and publishes oohelperd for Linux
|
2021-06-15 15:53:22 +02:00
|
|
|
name: oohelperd
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- "release/**"
|
2021-10-22 16:13:44 +02:00
|
|
|
- "oohelperd-staging"
|
2021-06-15 15:53:22 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_amd64:
|
|
|
|
runs-on: "ubuntu-20.04"
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-go@v1
|
|
|
|
with:
|
2021-11-10 14:18:04 +01:00
|
|
|
go-version: "1.17.3"
|
2021-06-15 15:53:22 +02:00
|
|
|
|
|
|
|
- name: build oohelperd binary
|
|
|
|
run: GOOS=linux GOARCH=amd64 go build -v ./internal/cmd/oohelperd
|
|
|
|
|
|
|
|
- run: find . -type f -name oohelperd
|
|
|
|
|
|
|
|
- name: install deps
|
|
|
|
run: |
|
|
|
|
sudo apt-get -q update
|
|
|
|
sudo apt-get install -yq --no-install-recommends curl devscripts \
|
|
|
|
dpkg-dev debhelper git python3 python3-requests python3-gnupg s3cmd
|
|
|
|
|
2021-10-22 17:21:38 +02:00
|
|
|
- name: update the debian changelog
|
|
|
|
run: |
|
|
|
|
version="$(go run ./internal/cmd/printversion)~$GITHUB_RUN_NUMBER"
|
|
|
|
cd ./internal/cmd/oohelperd
|
|
|
|
dch -v "$version" "New version ${version}"
|
|
|
|
|
2021-06-15 15:53:22 +02:00
|
|
|
- name: build deb package
|
|
|
|
run: |
|
|
|
|
cd ./internal/cmd/oohelperd
|
|
|
|
dpkg-buildpackage -us -uc -b
|
|
|
|
|
|
|
|
- name: upload package
|
2021-10-22 16:13:44 +02:00
|
|
|
if: github.ref == 'refs/heads/oohelperd-staging'
|
2021-06-15 15:53:22 +02:00
|
|
|
run: |
|
|
|
|
curl -fsSLO https://raw.githubusercontent.com/ooni/sysadmin/master/tools/debops-ci
|
|
|
|
chmod +x debops-ci
|
|
|
|
find . -name '*.deb'
|
|
|
|
./debops-ci --show-commands upload --bucket-name ooni-internal-deb --arch "amd64" internal/cmd/*.deb
|
|
|
|
env:
|
|
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
|
|
DEB_GPG_KEY: ${{ secrets.DEB_GPG_KEY }}
|