mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-06 22:18:28 +00:00
use multiarch CI build for release
This commit is contained in:
62
.github/workflows/ci.yml
vendored
62
.github/workflows/ci.yml
vendored
@@ -17,7 +17,7 @@ env:
|
|||||||
DEBIAN_FRONTEND: noninteractive
|
DEBIAN_FRONTEND: noninteractive
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
test:
|
||||||
name: "System Tests (Ubuntu 22.04)"
|
name: "System Tests (Ubuntu 22.04)"
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
continue-on-error: false
|
continue-on-error: false
|
||||||
@@ -93,9 +93,9 @@ jobs:
|
|||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
files: coverage.txt
|
files: coverage.txt
|
||||||
|
|
||||||
ci-debian:
|
ci-debian-build:
|
||||||
name: "CI Build"
|
name: "CI Build"
|
||||||
needs: build
|
needs: test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -180,17 +180,20 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
./upload-artifacts.sh release ${{ matrix.suite }}
|
./upload-artifacts.sh release ${{ matrix.suite }}
|
||||||
|
|
||||||
ci-other:
|
ci-release-build:
|
||||||
name: "CI Build (FreeBSD, MacOS, Linux)"
|
name: "CI Build (Binary)"
|
||||||
needs: build
|
needs: test
|
||||||
runs-on: ubuntu-latest
|
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:
|
steps:
|
||||||
- name: "Install packages"
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y --no-install-recommends make ca-certificates git curl devscripts
|
|
||||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
||||||
|
|
||||||
- name: "Checkout repository"
|
- name: "Checkout repository"
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
@@ -207,9 +210,40 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: ${{ steps.goversion.outputs.GOVER }}
|
go-version: ${{ steps.goversion.outputs.GOVER }}
|
||||||
|
|
||||||
- name: "Build goxc packages"
|
- name: "Build packages for ${{ matrix.goos }} ${{ matrix.goarch }}"
|
||||||
env:
|
env:
|
||||||
GOBIN: /usr/local/bin
|
GOBIN: /usr/local/bin
|
||||||
run: |
|
run: |
|
||||||
|
mkdir -p tmp/man tmp/completion/bash_completion.d tmp/completion/zsh/vendor-completions
|
||||||
go version
|
go version
|
||||||
make release
|
echo ${{ github.ref_name }} > VERSION
|
||||||
|
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o tmp/aptly -ldflags='-extldflags=-static'
|
||||||
|
cp man/aptly.1 tmp/man/
|
||||||
|
cp completion.d/aptly tmp/completion/bash_completion.d/
|
||||||
|
cp completion.d/_aptly tmp/completion/zsh/vendor-completions/
|
||||||
|
gzip tmp/man/aptly.1
|
||||||
|
path="aptly_${{ matrix.goos }}_${{ matrix.goarch }}"
|
||||||
|
mkdir -p $path
|
||||||
|
mv tmp "$path"
|
||||||
|
zip -r "$path" . -i "$path/*"
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: aptly_${{ matrix.goos }}_${{ matrix.goarch }}.zip
|
||||||
|
path: aptly_${{ matrix.goos }}_${{ matrix.goarch }}.zip
|
||||||
|
|
||||||
|
gh-release:
|
||||||
|
name: "Github Release: ${{ github.ref_name }}"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
continue-on-error: false
|
||||||
|
needs: ci-release-build
|
||||||
|
if: startsWith(github.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"
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -35,8 +35,6 @@ root/
|
|||||||
man/aptly.1.html
|
man/aptly.1.html
|
||||||
man/aptly.1.ronn
|
man/aptly.1.ronn
|
||||||
|
|
||||||
.goxc.local.json
|
|
||||||
|
|
||||||
system/env/
|
system/env/
|
||||||
|
|
||||||
# created by make build for release artifacts
|
# created by make build for release artifacts
|
||||||
|
|||||||
18
.goxc.json
18
.goxc.json
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"AppName": "aptly",
|
|
||||||
"ArtifactsDest": "xc-out/",
|
|
||||||
"TasksExclude": [
|
|
||||||
"rmbin",
|
|
||||||
"go-test",
|
|
||||||
"go-vet"
|
|
||||||
],
|
|
||||||
"ResourcesInclude": "README.rst,LICENSE,AUTHORS,man/aptly.1",
|
|
||||||
"BuildConstraints": "linux,386 linux,amd64 linux,arm linux,arm64 darwin,amd64 freebsd,386 freebsd,amd64",
|
|
||||||
"MainDirsExclude": "_man,vendor",
|
|
||||||
"BuildSettings": {
|
|
||||||
"LdFlagsXVars": {
|
|
||||||
"Version": "main.Version"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ConfigVersion": "0.9"
|
|
||||||
}
|
|
||||||
24
Makefile
24
Makefile
@@ -22,11 +22,6 @@ prepare: ## Install go module dependencies
|
|||||||
go mod tidy -v
|
go mod tidy -v
|
||||||
go generate
|
go generate
|
||||||
|
|
||||||
dev:
|
|
||||||
PATH=$(BINPATH)/:$(PATH)
|
|
||||||
go get github.com/laher/goxc
|
|
||||||
go install github.com/laher/goxc
|
|
||||||
|
|
||||||
check: system/env
|
check: system/env
|
||||||
ifeq ($(RUN_LONG_TESTS), yes)
|
ifeq ($(RUN_LONG_TESTS), yes)
|
||||||
system/env/bin/flake8
|
system/env/bin/flake8
|
||||||
@@ -88,23 +83,6 @@ mem.png: mem.dat mem.gp
|
|||||||
gnuplot mem.gp
|
gnuplot mem.gp
|
||||||
open mem.png
|
open mem.png
|
||||||
|
|
||||||
goxc: dev
|
|
||||||
rm -rf root/
|
|
||||||
mkdir -p root/usr/share/man/man1/ root/etc/bash_completion.d/ root/usr/share/zsh/vendor-completions/
|
|
||||||
cp man/aptly.1 root/usr/share/man/man1
|
|
||||||
cp completion.d/aptly root/etc/bash_completion.d/
|
|
||||||
cp completion.d/_aptly root/usr/share/zsh/vendor-completions/
|
|
||||||
gzip root/usr/share/man/man1/aptly.1
|
|
||||||
GOPATH=$(PWD)/.go go generate
|
|
||||||
GOPATH=$(PWD)/.go goxc -pv=$(VERSION) -max-processors=4 $(GOXC_OPTS)
|
|
||||||
|
|
||||||
release: GOXC_OPTS=-tasks-=go-vet,go-test,rmbin
|
|
||||||
release: goxc
|
|
||||||
rm -rf build/
|
|
||||||
mkdir -p build/
|
|
||||||
mv xc-out/$(VERSION)/aptly_$(VERSION)_* build/
|
|
||||||
ls -l build/
|
|
||||||
|
|
||||||
man: ## Create man pages
|
man: ## Create man pages
|
||||||
make -C man
|
make -C man
|
||||||
|
|
||||||
@@ -153,4 +131,4 @@ clean: ## remove local build and module cache
|
|||||||
test -d .go/ && chmod u+w -R .go/ && rm -rf .go/ || true
|
test -d .go/ && chmod u+w -R .go/ && rm -rf .go/ || true
|
||||||
rm -rf build/ docs/ obj-*-linux-gnu*
|
rm -rf build/ docs/ obj-*-linux-gnu*
|
||||||
|
|
||||||
.PHONY: help man prepare version release goxc docker-build-aptly-dev docker-system-tests docker-unit-tests docker-lint docker-build build docker-aptly clean
|
.PHONY: help man prepare version release docker-build-aptly-dev docker-system-tests docker-unit-tests docker-lint docker-build build docker-aptly clean
|
||||||
|
|||||||
Reference in New Issue
Block a user