Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix artifacts publishing #1061

Merged
merged 1 commit into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -109,15 +113,15 @@ 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')
env:
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')
Expand Down
6 changes: 4 additions & 2 deletions upload-artifacts.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down