Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/debianize #1339

Merged
merged 35 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4a104d1
debianize
neolynx Apr 21, 2024
d0ed0ab
support ~ in rootDir as home directory
neolynx Aug 2, 2024
28c47af
add default aptly config files
neolynx Aug 3, 2024
e1c7a55
use /usr/local/etc/aptly.conf config file
neolynx Sep 14, 2024
d824280
system tests: fix gpgv warning when verifying signatures
neolynx Aug 4, 2024
1bc2c04
docker: improve dev env
neolynx Aug 2, 2024
1af3515
CI: use go 1.22 for merging code code
neolynx Sep 12, 2024
6c0fcc1
github CI: use dpkg-buildpackage for building debian packages
neolynx Apr 21, 2024
de73a1d
ci: improve aptly repo layout
neolynx Sep 13, 2024
fe22ac4
do not hardcode go version
neolynx Sep 15, 2024
7e04043
ci: use async aptly publish
neolynx Sep 14, 2024
c6f3691
catch config file errors
neolynx Sep 14, 2024
20e051f
release for ubu24.04
neolynx Sep 15, 2024
b5a0019
update or downgrade go modules to match debian versions
neolynx Sep 16, 2024
8e33f09
build for Debian trixie (testing)
neolynx Sep 15, 2024
cabf609
ci upload: handle errors
neolynx Sep 16, 2024
f1eb28f
debian: fix config migration
neolynx Sep 16, 2024
73736af
use unique and incremental CI version
neolynx Sep 17, 2024
a9089d2
remove debug
neolynx Sep 17, 2024
e149f38
use multiarch CI build for release
iofq Sep 15, 2024
95caaa3
move release script to Makefile
iofq Sep 19, 2024
9be7eb5
system-tests: download compressed etcd.db
neolynx Sep 19, 2024
9d0e1c6
improve CI workflow
neolynx Sep 19, 2024
d342710
ci: do not unzip articact upload
neolynx Sep 20, 2024
9075665
ci: move scripts to makefile
neolynx Sep 21, 2024
1d80214
system tests: enable S3 tests
neolynx Sep 21, 2024
faa31b1
ci: do not upload ci on release builds
neolynx Sep 21, 2024
79ebaf6
debian: move config file to aptly-api
neolynx Sep 21, 2024
cb82b2c
ci: allow pull requests
neolynx Sep 21, 2024
efa26d4
fix github-upload
neolynx Sep 21, 2024
0aabac0
ci: log aptly version
neolynx Sep 21, 2024
a4a8148
update man page
neolynx Sep 21, 2024
c20568f
ci: use tag/branch for release/ci building
neolynx Sep 21, 2024
9c8fa20
ci: skip deb upload if no creds
neolynx Sep 21, 2024
dc7fa1c
ci: allow to force ci build
neolynx Sep 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
.go
.git
.go/
.git/
obj-x86_64-linux-gnu/
unit.out
aptly.test
build/
231 changes: 167 additions & 64 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Based on https://github.com/aptly-dev/aptly/blob/master/.travis.yml

name: CI

on:
Expand All @@ -13,14 +11,14 @@ on:
defaults:
run:
# see: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell
shell: bash --noprofile --norc -eo pipefail -x {0}
shell: bash --noprofile --norc -eo pipefail {0}

env:
DEBIAN_FRONTEND: noninteractive

jobs:
build:
name: test
test:
name: "System Tests (Ubuntu 22.04)"
runs-on: ubuntu-22.04
continue-on-error: false
timeout-minutes: 30
Expand All @@ -30,39 +28,43 @@ jobs:
BOTO_CONFIG: /dev/null
GO111MODULE: "on"
GOPROXY: "https://proxy.golang.org"
GOVER: '1.21'

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: "Install packages"
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends graphviz gnupg2 gpgv2 git gcc make devscripts

- name: Setup Go
uses: actions/setup-go@v3
- name: "Checkout repository"
uses: actions/checkout@v3
with:
go-version: ${{ env.GOVER }}
# fetch the whole repo for `git describe` to work
fetch-depth: 0

- name: Get aptly version
- name: "Read go version from go.mod"
run: |
make version
go generate
gover=$(sed -n 's/^go \(.*\)/\1/p' go.mod)
echo "Go Version: $gover"
echo "GOVER=$gover" >> $GITHUB_OUTPUT
id: goversion

- name: "Setup Go"
uses: actions/setup-go@v3
with:
go-version: ${{ steps.goversion.outputs.GOVER }}

- name: Setup Python
- name: "Setup Python"
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install O/S packages
run: |
sudo apt-get update
sudo apt-get install -y graphviz gnupg2 gpgv2 git gcc make

- name: Install Python packages
- name: "Install Python packages"
run: |
pip install six packaging appdirs virtualenv
pip install -U pip setuptools
pip install -r system/requirements.txt

- name: Install Azurite
- name: "Install Azurite"
id: azuright
uses: potatoqualitee/[email protected]
with:
Expand All @@ -74,6 +76,8 @@ jobs:
AZURE_STORAGE_ENDPOINT: "http://127.0.0.1:10000/devstoreaccount1"
AZURE_STORAGE_ACCOUNT: "devstoreaccount1"
AZURE_STORAGE_ACCESS_KEY: "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
sudo mkdir -p /srv ; sudo chown runner /srv
COVERAGE_DIR=${{ runner.temp }} make all
Expand All @@ -89,81 +93,180 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.txt

release:
needs: build
ci-debian-build:
name: "Build"
needs: test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
name: [Ubuntu-20, Ubuntu-22, Debian-10, Debian-11, Debian-12]
name: ["Debian 13/testing", "Debian 12/bookworm", "Debian 11/bullseye", "Debian 10/buster", "Ubuntu 24.04", "Ubuntu 22.04", "Ubuntu 20.04"]
arch: ["amd64", "i386" , "arm64" , "armhf"]
include:
- name: Ubuntu-20
image: "ubuntu:20.04"
suite: focal
GOVER: '1.21'
install: "make ca-certificates git curl"
- name: Ubuntu-22
image: "ubuntu:22.04"
suite: jammy
install: "make ca-certificates git curl golang"
- name: Debian-10
image: "debian:buster"
suite: buster
GOVER: '1.21'
install: "make ca-certificates git curl"
- name: Debian-11
image: "debian:bullseye"
suite: bullseye
GOVER: '1.21'
install: "make ca-certificates git curl"
- name: Debian-12
image: "debian:bookworm"
- name: "Debian 13/testing"
suite: trixie
image: debian:trixie-slim
- name: "Debian 12/bookworm"
suite: bookworm
install: "make ca-certificates git curl golang"
image: debian:bookworm-slim
- name: "Debian 11/bullseye"
suite: bullseye
image: debian:bullseye-slim
- name: "Debian 10/buster"
suite: buster
image: debian:buster-slim
- name: "Ubuntu 24.04"
suite: noble
image: ubuntu:24.04
- name: "Ubuntu 22.04"
suite: jammy
neolynx marked this conversation as resolved.
Show resolved Hide resolved
image: ubuntu:22.04
- name: "Ubuntu 20.04"
suite: focal
image: ubuntu:20.04
container:
image: ${{ matrix.image }}
env:
APT_LISTCHANGES_FRONTEND: none
DEBIAN_FRONTEND: noninteractive
steps:
- name: Install O/S packages
- name: "Install packages"
run: |
apt-get update
apt-get install -y --no-install-recommends ${{ matrix.install }}
apt-get install -y --no-install-recommends make ca-certificates git curl build-essential devscripts dh-golang binutils-i686-linux-gnu binutils-aarch64-linux-gnu binutils-arm-linux-gnueabihf jq
git config --global --add safe.directory "$GITHUB_WORKSPACE"
echo GOVER: ${{ env.GOVER }}

- name: Checkout repository
- name: "Checkout repository"
uses: actions/checkout@v3
with:
# fetch the whole repo for `git describe` to
# work and get the nightly verion
# fetch the whole repo for `git describe` to work
fetch-depth: 0

- name: Setup Go
if: ${{ matrix.GOVER != '' }}
- name: "Read go version from go.mod"
run: |
gover=$(sed -n 's/^go \(.*\)/\1/p' go.mod)
echo "Go Version: $gover"
echo "GOVER=$gover" >> $GITHUB_OUTPUT
id: goversion

- name: "Setup Go"
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.GOVER }}
go-version: ${{ steps.goversion.outputs.GOVER }}

- name: "Ensure CI build"
if: github.ref == 'refs/heads/master'
run: |
echo "FORCE_CI=true" >> $GITHUB_OUTPUT
id: force_ci

- name: Make Release
- name: "Build Debian packages"
env:
GOBIN: /usr/local/bin
FORCE_CI: ${{ steps.force_ci.outputs.FORCE_CI }}
run: |
make release
make dpkg DEBARCH=${{ matrix.arch }}

- name: Publish nightly release to aptly
if: github.ref == 'refs/heads/master'
- name: "Check aptly credentials"
env:
APTLY_USER: ${{ secrets.APTLY_USER }}
APTLY_PASSWORD: ${{ secrets.APTLY_PASSWORD }}
run: |
./upload-artifacts.sh nightly ${{ matrix.suite }}
found=no
if [ -n "$APTLY_USER" ] && [ -n "$APTLY_PASSWORD" ]; then
found=yes
fi
echo "Aptly credentials available: $found"
echo "FOUND=$found" >> $GITHUB_OUTPUT
id: aptlycreds

- name: Publish release to aptly
if: startsWith(github.event.ref, 'refs/tags')
- name: "Publish CI release to aptly"
if: github.ref == 'refs/heads/master' && steps.aptlycreds.outputs.FOUND == 'yes'
env:
APTLY_USER: ${{ secrets.APTLY_USER }}
APTLY_PASSWORD: ${{ secrets.APTLY_PASSWORD }}
run: |
./upload-artifacts.sh ci ${{ matrix.suite }}

- name: "Publish release to aptly"
if: startsWith(github.event.ref, 'refs/tags') && steps.aptlycreds.outputs.FOUND == 'yes'
env:
APTLY_USER: ${{ secrets.APTLY_USER }}
APTLY_PASSWORD: ${{ secrets.APTLY_PASSWORD }}
run: |
./upload-artifacts.sh release ${{ matrix.suite }}

ci-binary-build:
name: "Build"
needs: test
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, freebsd, darwin]
goarch: ["386", "amd64", "arm", "arm64"]
exclude:
- goos: darwin
goarch: 386
- goos: darwin
goarch: arm
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
with:
# fetch the whole repo for `git describe` to work
fetch-depth: 0

- name: "Read go version from go.mod"
run: |
echo "GOVER=$(sed -n 's/^go \(.*\)/\1/p' go.mod)" >> $GITHUB_OUTPUT
id: goversion

- name: "Setup Go"
uses: actions/setup-go@v3
with:
go-version: ${{ steps.goversion.outputs.GOVER }}

- name: "Ensure CI build"
if: github.ref == 'refs/heads/master'
run: |
echo "FORCE_CI=true" >> $GITHUB_OUTPUT
id: force_ci

- name: "Get aptly version"
env:
FORCE_CI: ${{ steps.force_ci.outputs.FORCE_CI }}
run: |
aptlyver=$(make -s version)
echo "Aptly Version: $aptlyver"
echo "VERSION=$aptlyver" >> $GITHUB_OUTPUT
id: releaseversion

- name: "Build aptly ${{ matrix.goos }}/${{ matrix.goarch }}"
env:
GOBIN: /usr/local/bin
FORCE_CI: ${{ steps.force_ci.outputs.FORCE_CI }}
run: |
make binaries GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }}

- uses: actions/upload-artifact@v4
if: startsWith(github.event.ref, 'refs/tags')
with:
name: aptly_${{ steps.releaseversion.outputs.VERSION }}_${{ matrix.goos }}_${{ matrix.goarch }}
path: build/aptly_${{ steps.releaseversion.outputs.VERSION }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip
compression-level: 0 # no compression

gh-release:
name: "Github Release"
runs-on: ubuntu-latest
continue-on-error: false
needs: ci-binary-build
if: startsWith(github.event.ref, 'refs/tags')
steps:
- name: "Download Artifacts"
uses: actions/download-artifact@v4
with:
path: out/

- name: "Release"
uses: softprops/action-gh-release@v2
with:
files: "out/**/aptly_*.zip"
13 changes: 10 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5

- name: "Read go version from go.mod"
run: |
echo "GOVER=$(sed -n 's/^go \(.*\)/\1/p' go.mod)" >> $GITHUB_OUTPUT
id: goversion

- name: "Setup Go"
uses: actions/setup-go@v3
with:
go-version: '1.21'
cache: false
go-version: ${{ steps.goversion.outputs.GOVER }}

- name: Create VERSION file
run: |
make -s version | tr -d '\n' > VERSION
Expand Down
20 changes: 18 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ root/
man/aptly.1.html
man/aptly.1.ronn

.goxc.local.json

system/env/

# created by make build for release artifacts
Expand All @@ -52,3 +50,21 @@ pgp/keyrings/.#*
*.creds

.go/
obj-x86_64-linux-gnu/

# debian
debian/.debhelper/
debian/aptly.debhelper.log
debian/aptly.postrm.debhelper
debian/aptly.substvars
debian/aptly/
debian/debhelper-build-stamp
debian/files
debian/aptly-api/
debian/aptly-api.debhelper.log
debian/aptly-api.postrm.debhelper
debian/aptly-api.substvars
debian/aptly-dbg.debhelper.log
debian/aptly-dbg.substvars
debian/aptly-dbg/

Loading
Loading