Skip to content

Commit

Permalink
Merge pull request #36 from gizmoguy/cloudsmith-any
Browse files Browse the repository at this point in the history
Publish debian packages to special cloudsmith any-distro/any-version target.
  • Loading branch information
gizmoguy committed Nov 23, 2021
2 parents c99ca7e + daf75da commit d8b0653
Showing 1 changed file with 2 additions and 39 deletions.
41 changes: 2 additions & 39 deletions .github/workflows/dpkg-build.yml
Expand Up @@ -11,42 +11,10 @@ env:
DEBFULLNAME: Bearwall Maintainers

jobs:
build-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Build matrix
id: set-matrix
run: |
git_tmp_dir=$(mktemp -d /tmp/distro-info-data-XXXXX)
git clone --depth 1 https://salsa.debian.org/debian/distro-info-data "${git_tmp_dir}"
releases=()
for release in $(awk -F ',' -v today="$(date --utc "+%F")" \
'BEGIN {OFS=","} NR>1 { if (($6 == "" || $6 >= today) && ($5 != "" && $5 <= today)) print $3 }' \
"${git_tmp_dir}/ubuntu.csv"); do
releases+=("ubuntu:${release}")
done
for release in $(awk -F ',' -v today="$(date --utc "+%F")" \
'BEGIN {OFS=","} NR>1 { if (($6 == "" || $6 >= today) && ($4 != "" && $4 <= today)) print $3 }' \
"${git_tmp_dir}/debian.csv" | grep -v -E "(sid|experimental)"); do
releases+=("debian:${release}")
done
releases+=("debian:stretch")
releases+=("ubuntu:xenial")
matrix=$(printf "%s\n" "${releases[@]}" | jq -nRc '[inputs]')
echo "::set-output name=matrix::${matrix}"
build:
runs-on: ubuntu-latest
needs: build-matrix
container:
image: ${{ matrix.target }}
strategy:
matrix:
arch:
- amd64
target: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
image: debian:latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
Expand All @@ -55,10 +23,6 @@ jobs:
apt-get update
apt-get -y upgrade
apt-get -y install devscripts dpkg-dev debhelper equivs
- name: Backport build tools on xenial
run: |
apt-get install -t xenial-backports --no-install-recommends --no-install-suggests -y debhelper
if: matrix.target == 'ubuntu:xenial'
- name: Bump version
run: |
export git_version=${GITHUB_REF##*/}
Expand All @@ -70,8 +34,7 @@ jobs:
run: |
mk-build-deps -i -r -t 'apt-get -f -y --force-yes'
make deb
dirname=$(echo ${{ matrix.target }} | tr ':' '_')
package_path="${GITHUB_WORKSPACE}/packages/${dirname}"
package_path="${GITHUB_WORKSPACE}/packages/any-distro_any-version"
mkdir -p "${package_path}"
mv ../*.deb "${package_path}"
- name: Publish packages to cloudsmith
Expand Down

0 comments on commit d8b0653

Please sign in to comment.