From e911c1e355ee18c761f050d24045986bb3d31920 Mon Sep 17 00:00:00 2001 From: Benj Fassbind Date: Tue, 12 Apr 2022 14:55:29 +0200 Subject: [PATCH] Fix artifacts publishing --- .github/workflows/ci.yml | 10 +++++++--- upload-artifacts.sh | 6 ++++-- 2 files changed, 11 insertions(+), 5 deletions(-) mode change 100644 => 100755 upload-artifacts.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c916b1ac..063df4d84 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,7 +92,11 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 + with: + # fetch the whole repot for `git describe` to + # work and get the nightly verion + fetch-depth: 0 - name: Setup Go uses: actions/setup-go@v2 @@ -109,7 +113,7 @@ jobs: APTLY_USER: ${{ secrets.APTLY_USER }} APTLY_PASSWORD: ${{ secrets.APTLY_PASSWORD }} run: | - bash upload-artifacts.sh nightly + ./upload-artifacts.sh nightly - name: Publish release to aptly if: startsWith(github.event.ref, 'refs/tags') @@ -117,7 +121,7 @@ jobs: APTLY_USER: ${{ secrets.APTLY_USER }} APTLY_PASSWORD: ${{ secrets.APTLY_PASSWORD }} run: | - bash upload-artifacts.sh release + ./upload-artifacts.sh release - name: Upload artifacts to GitHub Release if: startsWith(github.event.ref, 'refs/tags') diff --git a/upload-artifacts.sh b/upload-artifacts.sh old mode 100644 new mode 100755 index b1413e6d0..3a47db3f5 --- a/upload-artifacts.sh +++ b/upload-artifacts.sh @@ -10,13 +10,15 @@ aptly_password="$APTLY_PASSWORD" aptly_api="https://aptly-ops.aptly.info" version=`make version` +echo "Publishing version '$version' to $1..." + for file in $packages; do echo "Uploading $file..." curl -fsS -X POST -F "file=@$file" -u $aptly_user:$aptly_password ${aptly_api}/api/files/$folder echo done -if [[ "$1" = "nightly" ]]; then +if [ "$1" = "nightly" ]; then if echo "$version" | grep -vq "+"; then # skip nightly when on release tag exit 0 @@ -37,7 +39,7 @@ if [[ "$1" = "nightly" ]]; then echo fi -if [[ "$1" = "release" ]]; then +if [ "$1" = "release" ]; then aptly_repository=aptly-release aptly_snapshot=aptly-$version aptly_published=s3:repo.aptly.info:./squeeze