CI: packages.yml: upload to grimler.se as well

This commit is contained in:
Henrik Grimler 2022-03-09 08:38:08 +01:00
parent e7f3a436ae
commit ccf1b2d111
No known key found for this signature in database
GPG Key ID: B0076E490B71616B
1 changed files with 42 additions and 0 deletions

View File

@ -217,3 +217,45 @@ jobs:
exit 1
fi
fi
- name: Upload to grimler.se
# Run even if upload to packages.termux.org failed:
if: always()
env:
REPOSITORY_NAME: termux-main
REPOSITORY_DISTRIBUTION: stable
REPOSITORY_URL: https://aptly-api.grimler.se
run: |
GITHUB_SHA=${{ github.sha }}
APTLY_API_AUTH=${{ secrets.APTLY_API_AUTH }}
source scripts/aptly_api.sh
for archive in termux-packages-*/*.tar; do
tar xf "$archive"
done
# Upload file to temporary directory.
uploaded_files=false
shopt -s nullglob
for filename in $(cat debs/built_packages.txt | sed -E 's/(..*)/debs\/\1_\*.deb debs\/\1-static_\*.deb/g'); do
if ! aptly_upload_file "$filename"; then
exit 1
fi
uploaded_files=true
done
shopt -u nullglob
# Publishing repository changes.
if [ "$uploaded_files" = "true" ]; then
aptly_add_to_repo
# Usually temporary directory is deleted automatically, but in certain cases it is left.
aptly_delete_dir
# grimler.se mirror is signed manually, can't publish
# through CI
# if ! aptly_publish_repo; then
# exit 1
# fi
fi