From 01e4f30e79462e205ecf610e47cea22f4c298719 Mon Sep 17 00:00:00 2001 From: Viktor Erlingsson Date: Thu, 24 Oct 2024 11:18:44 +0200 Subject: [PATCH] Fix action (#1) fixes action --- .github/workflows/ci.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3ab61d..ecaa6a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,21 +14,11 @@ permissions: jobs: debian: - name: Debian pkg + name: Deb packages runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - base_image: ubuntu - version: 24.04 - codename: noble - steps: - - name: Checkout - uses: actions/checkout@v3 - - uses: depot/setup-action@v1 - - uses: depot/build-push-action@v1 + - name: Make deb packages + uses: docker/build-push-action@v6 with: file: Dockerfile pull: true @@ -38,6 +28,16 @@ jobs: with: name: etcd-pkgs path: pkgs - #- name: Upload deb packages to Packagecloud - # run: find pkgs -name "*.deb" -exec curl -fsSu "${{ secrets.packagecloud_token }}:" -F "package[distro_version_id]=35" -F "package[package_file]=@{}" -XPOST https://packagecloud.io/api/v1/repos/84codes/etcd/packages.json \; - # if: github.ref == 'refs/heads/main' \ No newline at end of file + - name: Upload deb packages to Packagecloud + if: github.ref == 'refs/heads/main' + run: | + set -eux + curl -fsSO -u "${{ secrets.PACKAGECLOUD_TOKEN }}:" https://packagecloud.io/api/v1/distributions.json + for PKG_FILE in $(find pkgs -name "*.deb") + do + DIST_ID=$(jq ".deb[] | select(.index_name == \"ubuntu\").versions[] | select(.index_name == \"noble\").id" distributions.json) + curl -fsS -u "${{ secrets.PACKAGECLOUD_TOKEN }}:" -XPOST \ + -F "package[distro_version_id]=${DIST_ID}" \ + -F "package[package_file]=@${PKG_FILE}" \ + https://packagecloud.io/api/v1/repos/84codes/etcd/packages.json + done