Fix artifacts publishing

This commit is contained in:
Benj Fassbind
2022-04-12 14:55:29 +02:00
parent db19a56458
commit d955b06f03
2 changed files with 11 additions and 5 deletions
+7 -3
View File
@@ -92,7 +92,11 @@ jobs:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
- name: Checkout repository - 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 - name: Setup Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
@@ -109,7 +113,7 @@ jobs:
APTLY_USER: ${{ secrets.APTLY_USER }} APTLY_USER: ${{ secrets.APTLY_USER }}
APTLY_PASSWORD: ${{ secrets.APTLY_PASSWORD }} APTLY_PASSWORD: ${{ secrets.APTLY_PASSWORD }}
run: | run: |
bash upload-artifacts.sh nightly ./upload-artifacts.sh nightly
- name: Publish release to aptly - name: Publish release to aptly
if: startsWith(github.event.ref, 'refs/tags') if: startsWith(github.event.ref, 'refs/tags')
@@ -117,7 +121,7 @@ jobs:
APTLY_USER: ${{ secrets.APTLY_USER }} APTLY_USER: ${{ secrets.APTLY_USER }}
APTLY_PASSWORD: ${{ secrets.APTLY_PASSWORD }} APTLY_PASSWORD: ${{ secrets.APTLY_PASSWORD }}
run: | run: |
bash upload-artifacts.sh release ./upload-artifacts.sh release
- name: Upload artifacts to GitHub Release - name: Upload artifacts to GitHub Release
if: startsWith(github.event.ref, 'refs/tags') if: startsWith(github.event.ref, 'refs/tags')
Regular → Executable
+4 -2
View File
@@ -10,13 +10,15 @@ aptly_password="$APTLY_PASSWORD"
aptly_api="https://aptly-ops.aptly.info" aptly_api="https://aptly-ops.aptly.info"
version=`make version` version=`make version`
echo "Publishing version '$version' to $1..."
for file in $packages; do for file in $packages; do
echo "Uploading $file..." echo "Uploading $file..."
curl -fsS -X POST -F "file=@$file" -u $aptly_user:$aptly_password ${aptly_api}/api/files/$folder curl -fsS -X POST -F "file=@$file" -u $aptly_user:$aptly_password ${aptly_api}/api/files/$folder
echo echo
done done
if [[ "$1" = "nightly" ]]; then if [ "$1" = "nightly" ]; then
if echo "$version" | grep -vq "+"; then if echo "$version" | grep -vq "+"; then
# skip nightly when on release tag # skip nightly when on release tag
exit 0 exit 0
@@ -37,7 +39,7 @@ if [[ "$1" = "nightly" ]]; then
echo echo
fi fi
if [[ "$1" = "release" ]]; then if [ "$1" = "release" ]; then
aptly_repository=aptly-release aptly_repository=aptly-release
aptly_snapshot=aptly-$version aptly_snapshot=aptly-$version
aptly_published=s3:repo.aptly.info:./squeeze aptly_published=s3:repo.aptly.info:./squeeze