From 9c64adc8d31c53bb756a575165b3d7613321046b Mon Sep 17 00:00:00 2001
From: Francis Lavoie
Date: Mon, 28 Dec 2020 17:32:21 -0500
Subject: [PATCH 1/5] ci: Add pushing to cloudsmith
---
.github/workflows/release.yml | 50 +++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index a51a35dde0a..fa87883a4b1 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -27,6 +27,10 @@ jobs:
- name: Unshallowify the repo clone
run: git fetch --prune --unshallow
+ # Cloudsmith CLI tooling for pushing releases
+ - name: Install Cloudsmith CLI
+ run: pip install --upgrade cloudsmith-cli
+
# https://github.community/t5/GitHub-Actions/How-to-get-just-the-tag-name/m-p/32167/highlight/true#M1027
- name: Print Go version and environment
id: vars
@@ -88,6 +92,52 @@ jobs:
GEMFURY_PUSH_TOKEN: ${{ secrets.GEMFURY_PUSH_TOKEN }}
run: |
for filename in dist/*.deb; do
+ # armv6 and armv7 are both "armhf" so we can skip the duplicate
+ if [[ "$filename" == *"armv7"* ]]; then
+ echo "Skipping $filename"
+ continue
+ fi
+
curl -F package=@"$filename" https://${GEMFURY_PUSH_TOKEN}:@push.fury.io/caddy/
done
+ # Publish only special tags (unstable/beta/rc) to the "testing" repo
+ # See https://cloudsmith.io/~caddy/repos/testing/
+ - name: Publish .deb to Cloudsmith (special tags)
+ if: ${{ steps.vars.outputs.tag_special != '' }}
+ env:
+ # TODO:
+ # CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
+ run: |
+ for filename in dist/*.deb; do
+ # armv6 and armv7 are both "armhf" so we can skip the duplicate
+ if [[ "$filename" == *"armv7"* ]]; then
+ echo "Skipping $filename"
+ continue
+ fi
+
+ echo "Pushing $filename to 'testing'"
+ cloudsmith push deb caddy/testing/any-distro/any-version $filename
+ done
+
+ # Publish stable tags to Cloudsmith to both repos, "stable" and "testing"
+ # See https://cloudsmith.io/~caddy/repos/stable/
+ - name: Publish .deb to Cloudsmith (stable tags)
+ if: ${{ steps.vars.outputs.tag_special == '' }}
+ env:
+ # TODO:
+ # CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
+ run: |
+ for filename in dist/*.deb; do
+ # armv6 and armv7 are both "armhf" so we can skip the duplicate
+ if [[ "$filename" == *"armv7"* ]]; then
+ echo "Skipping $filename"
+ continue
+ fi
+
+ echo "Pushing $filename to 'stable'"
+ cloudsmith push deb caddy/stable/any-distro/any-version $filename
+
+ echo "Pushing $filename to 'testing'"
+ cloudsmith push deb caddy/testing/any-distro/any-version $filename
+ done
\ No newline at end of file
From 588adf527031f773623b927c5e241bcd74e29fef Mon Sep 17 00:00:00 2001
From: Francis Lavoie
Date: Tue, 29 Dec 2020 14:50:47 -0500
Subject: [PATCH 2/5] ci: Update comments, remove env TODO
---
.github/workflows/release.yml | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index fa87883a4b1..49634ca9219 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -86,6 +86,9 @@ jobs:
TAG: ${{ steps.vars.outputs.version_tag }}
# Only publish on non-special tags (e.g. non-beta)
+ # We will continue to push to Gemfury for the forseeable future, although
+ # Cloudsmith is probably better, to not break things for existing users of Gemfury.
+ # See https://gemfury.com/caddy/deb:caddy
- name: Publish .deb to Gemfury
if: ${{ steps.vars.outputs.tag_special == '' }}
env:
@@ -106,8 +109,7 @@ jobs:
- name: Publish .deb to Cloudsmith (special tags)
if: ${{ steps.vars.outputs.tag_special != '' }}
env:
- # TODO:
- # CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
+ CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: |
for filename in dist/*.deb; do
# armv6 and armv7 are both "armhf" so we can skip the duplicate
@@ -125,8 +127,7 @@ jobs:
- name: Publish .deb to Cloudsmith (stable tags)
if: ${{ steps.vars.outputs.tag_special == '' }}
env:
- # TODO:
- # CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
+ CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: |
for filename in dist/*.deb; do
# armv6 and armv7 are both "armhf" so we can skip the duplicate
@@ -140,4 +141,4 @@ jobs:
echo "Pushing $filename to 'testing'"
cloudsmith push deb caddy/testing/any-distro/any-version $filename
- done
\ No newline at end of file
+ done
From 9a360cfc1b08c933aebe1e801b6098a5928a975b Mon Sep 17 00:00:00 2001
From: Francis Lavoie
Date: Tue, 29 Dec 2020 16:41:29 -0500
Subject: [PATCH 3/5] ci: Fix Cloudsmith installation by setting PATH
---
.github/workflows/release.yml | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 49634ca9219..cd1647ab58d 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -27,10 +27,6 @@ jobs:
- name: Unshallowify the repo clone
run: git fetch --prune --unshallow
- # Cloudsmith CLI tooling for pushing releases
- - name: Install Cloudsmith CLI
- run: pip install --upgrade cloudsmith-cli
-
# https://github.community/t5/GitHub-Actions/How-to-get-just-the-tag-name/m-p/32167/highlight/true#M1027
- name: Print Go version and environment
id: vars
@@ -45,6 +41,9 @@ jobs:
echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
echo "::set-output name=go_cache::$(go env GOCACHE)"
+ # Add "pip install" CLI tools to PATH
+ echo ~/.local/bin >> $GITHUB_PATH
+
# Parse semver
TAG=${GITHUB_REF/refs\/tags\//}
SEMVER_RE='[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\([0-9A-Za-z\.-]*\)'
@@ -57,6 +56,11 @@ jobs:
echo "::set-output name=tag_patch::${TAG_PATCH}"
echo "::set-output name=tag_special::${TAG_SPECIAL}"
+ # Cloudsmith CLI tooling for pushing releases
+ # See https://help.cloudsmith.io/docs/cli
+ - name: Install Cloudsmith CLI
+ run: pip install --upgrade cloudsmith-cli
+
- name: Validate commits and tag signatures
run: |
From 382131967b14b72ff4a7e01dff11a4d1f40d4919 Mon Sep 17 00:00:00 2001
From: Francis Lavoie
Date: Tue, 29 Dec 2020 22:33:42 -0500
Subject: [PATCH 4/5] docs: Add Cloudsmith attribution to README
---
README.md | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 90753653891..316a56a95c9 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,9 @@
+
+
Releases ยท
@@ -187,4 +189,6 @@ Please use our [issue tracker](https://github.com/caddyserver/caddy/issues) only
- _Project on Twitter: [@caddyserver](https://twitter.com/caddyserver)_
- _Author on Twitter: [@mholt6](https://twitter.com/mholt6)_
-Caddy is a project of [ZeroSSL](https://zerossl.com), an [apilayer](https://apilayer.com) company.
\ No newline at end of file
+Caddy is a project of [ZeroSSL](https://zerossl.com), an [apilayer](https://apilayer.com) company.
+
+Debian package repository hosting is graciously provided by [Cloudsmith](https://cloudsmith.com). Cloudsmith is the only fully hosted, cloud-native, universal package management solution, that enables your organization to create, store and share packages in any format, to any place, with total confidence.
\ No newline at end of file
From b1bba925f36c346695acf601fda57c6e6f622356 Mon Sep 17 00:00:00 2001
From: Francis Lavoie
Date: Wed, 30 Dec 2020 12:47:41 -0500
Subject: [PATCH 5/5] ci: Switch to keeping armv7 as the armhf .deb
---
.github/workflows/release.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index cd1647ab58d..c09f2379aed 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -100,7 +100,7 @@ jobs:
run: |
for filename in dist/*.deb; do
# armv6 and armv7 are both "armhf" so we can skip the duplicate
- if [[ "$filename" == *"armv7"* ]]; then
+ if [[ "$filename" == *"armv6"* ]]; then
echo "Skipping $filename"
continue
fi
@@ -117,7 +117,7 @@ jobs:
run: |
for filename in dist/*.deb; do
# armv6 and armv7 are both "armhf" so we can skip the duplicate
- if [[ "$filename" == *"armv7"* ]]; then
+ if [[ "$filename" == *"armv6"* ]]; then
echo "Skipping $filename"
continue
fi
@@ -135,7 +135,7 @@ jobs:
run: |
for filename in dist/*.deb; do
# armv6 and armv7 are both "armhf" so we can skip the duplicate
- if [[ "$filename" == *"armv7"* ]]; then
+ if [[ "$filename" == *"armv6"* ]]; then
echo "Skipping $filename"
continue
fi