-
Notifications
You must be signed in to change notification settings - Fork 530
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate release pipeline from Drone to GHA (#4503)
- Loading branch information
1 parent
71e8531
commit e3c2848
Showing
5 changed files
with
80 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: release | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
|
||
# Needed to login to DockerHub | ||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
|
||
release: | ||
if: github.repository == 'grafana/tempo' # skip in forks | ||
runs-on: ubuntu-24.04 | ||
env: | ||
NFPM_SIGNING_KEY_FILE: /tmp/nfpm-private-key.key | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: fetch tags | ||
run: git fetch --tags | ||
|
||
- id: "get-secrets" | ||
name: "get nfpm signing keys" | ||
uses: "grafana/shared-workflows/actions/get-vault-secrets@main" | ||
with: | ||
common_secrets: | | ||
NFPM_SIGNING_KEY=packages-gpg:private-key | ||
NFPM_DEFAULT_PASSPHRASE=packages-gpg:passphrase | ||
- name: write-key | ||
run: printenv NFPM_SIGNING_KEY > $NFPM_SIGNING_KEY_FILE | ||
|
||
- name: test release | ||
run: make release-snapshot | ||
|
||
- name: test deb package | ||
run: | | ||
# podman is simpler to make it work with systemd inside containers | ||
podman run -d --name systemd-debian --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro jrei/systemd-debian:12 | ||
podman cp ./dist/tempo_*_linux_amd64.deb systemd-debian:. | ||
podman cp ./tools/packaging/verify-deb-install.sh systemd-debian:. | ||
podman cp ./tools/packaging/wait-for-ready.sh systemd-debian:. | ||
podman exec systemd-debian ./verify-deb-install.sh | ||
podman rm -f systemd-debian | ||
- name: test rpm package | ||
run: | | ||
podman run -d --name systemd-centos --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro jrei/systemd-centos:8 | ||
podman cp ./dist/tempo_*_linux_amd64.rpm systemd-centos:. | ||
podman cp ./tools/packaging/verify-rpm-install.sh systemd-centos:. | ||
podman cp ./tools/packaging/wait-for-ready.sh systemd-centos:. | ||
podman exec systemd-centos ./verify-rpm-install.sh | ||
podman rm -f systemd-centos | ||
- name: release | ||
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: make release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,11 @@ | ||
#!/usr/bin/env sh | ||
#!/usr/bin/env bash | ||
|
||
set -euxo pipefail | ||
|
||
docker ps | ||
image="$(docker ps --filter ancestor=jrei/systemd-debian:12 --latest --format "{{.ID}}")" | ||
echo "Running on container: ${image}" | ||
# Install tempo and check it's running | ||
dpkg -i ./tempo_*_linux_amd64.deb | ||
[ "$(systemctl is-active tempo)" = "active" ] || (echo "tempo is inactive" && exit 1) | ||
|
||
dir="." | ||
if [ -n "${CI}" ]; then | ||
dir="/drone/src" | ||
fi | ||
echo "Running on directory: ${dir}" | ||
|
||
cat <<EOF | docker exec --interactive "${image}" sh | ||
set -x | ||
# Install tempo and check it's running | ||
dpkg -i ${dir}/dist/tempo*_amd64.deb | ||
[ "\$(systemctl is-active tempo)" = "active" ] || (echo "tempo is inactive" && exit 1) | ||
# Wait for tempo to be ready. The script is cat-ed because it is passed to docker exec | ||
apt update && apt install -y curl | ||
$(cat ${dir}/tools/packaging/wait-for-ready.sh) | ||
EOF | ||
# Wait for tempo to be ready. | ||
apt update && apt install -y curl | ||
./wait-for-ready.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,13 @@ | ||
#!/usr/bin/env sh | ||
#!/usr/bin/env bash | ||
|
||
set -euxo pipefail | ||
|
||
docker ps | ||
image="$(docker ps --filter ancestor=jrei/systemd-centos:8 --latest --format "{{.ID}}")" | ||
echo "Running on container: ${image}" | ||
# Import the Grafana GPG key | ||
rpm --import https://packages.grafana.com/gpg.key | ||
|
||
dir="." | ||
if [ -n "${CI}" ]; then | ||
dir="/drone/src" | ||
fi | ||
echo "Running on directory: ${dir}" | ||
# Install tempo and check it's running | ||
rpm -i ./tempo_*_linux_amd64.rpm | ||
[ "$(systemctl is-active tempo)" = "active" ] || (echo "tempo is inactive" && exit 1) | ||
|
||
cat <<EOF | docker exec --interactive "${image}" sh | ||
set -x | ||
# Import the Grafana GPG key | ||
rpm --import https://packages.grafana.com/gpg.key | ||
# Install tempo and check it's running | ||
rpm -i ${dir}/dist/tempo*_amd64.rpm | ||
[ "\$(systemctl is-active tempo)" = "active" ] || (echo "tempo is inactive" && exit 1) | ||
# Wait for tempo to be ready. The script is cat-ed because it is passed to docker exec | ||
$(cat ${dir}/tools/packaging/wait-for-ready.sh) | ||
EOF | ||
# Wait for tempo to be ready. | ||
./wait-for-ready.sh |