cli: fix ping response time display #537
This file contains hidden or 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
| # SPDX-License-Identifier: BSD-3-Clause | |
| # Copyright (c) 2023 Robin Jarry | |
| --- | |
| name: Publish | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - v* | |
| jobs: | |
| check: | |
| permissions: | |
| contents: read | |
| actions: write | |
| uses: ./.github/workflows/check.yml | |
| package: | |
| permissions: | |
| contents: read | |
| actions: write | |
| uses: ./.github/workflows/package.yml | |
| upload: | |
| permissions: | |
| actions: read | |
| contents: write | |
| runs-on: ubuntu-24.04 | |
| needs: | |
| - check | |
| - package | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| pattern: "*-packages" | |
| merge-multiple: true | |
| - run: | | |
| rpm -qp --queryformat 'grout=%{VERSION}\n' grout.*.rpm >> $GITHUB_OUTPUT | |
| rpm -qp --queryformat 'frr=%{VERSION}\n' frr.*.rpm >> $GITHUB_OUTPUT | |
| id: version | |
| - uses: docker/setup-qemu-action@v4 | |
| - uses: docker/setup-buildx-action@v4 | |
| - uses: docker/login-action@v4 | |
| with: | |
| registry: quay.io | |
| username: ${{ secrets.QUAY_USER }} | |
| password: ${{ secrets.QUAY_TOKEN }} | |
| - uses: docker/metadata-action@v6 | |
| name: Extract metadata for the Docker image | |
| id: meta-grout | |
| with: | |
| images: "quay.io/${{ vars.REGISTRY_NAMESPACE || 'grout' }}/grout" | |
| tags: | | |
| type=edge,branch=main | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| labels: | | |
| frr_version=${{steps.version.outputs.frr}} | |
| grout_version=${{steps.version.outputs.grout}} | |
| - uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: Containerfile | |
| platforms: linux/amd64,linux/arm64 | |
| tags: ${{ steps.meta-grout.outputs.tags }} | |
| labels: ${{ steps.meta-grout.outputs.labels }} | |
| push: true | |
| - name: Update edge pre-release | |
| if: github.ref == 'refs/heads/main' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| notes=$(cat <<EOF | |
| Rolling pre-release from $(git rev-parse --short HEAD). | |
| Container image: | |
| podman run --rm --name grout \\ | |
| --device /dev/net/tun --device /dev/vfio \\ | |
| -v /dev/hugepages:/dev/hugepages \\ | |
| --cap-add NET_ADMIN,IPC_LOCK \\ | |
| quay.io/grout/grout:edge | |
| EOF | |
| ) | |
| if gh release view edge > /dev/null 2>&1; then | |
| gh api -X PATCH /repos/{owner}/{repo}/git/refs/tags/edge \ | |
| -f sha="$(git rev-parse HEAD)" -F force=true | |
| gh release edit edge --title "Edge (unstable)" --notes "$notes" | |
| gh release view edge --json assets --jq '.assets[].name' | | |
| while read -r asset; do | |
| gh release delete-asset edge "$asset" --yes | |
| done | |
| gh release upload edge *.rpm *.*deb | |
| else | |
| gh api -X POST /repos/{owner}/{repo}/git/refs \ | |
| -f ref="refs/tags/edge" -f sha="$(git rev-parse HEAD)" | |
| gh release create edge --prerelease \ | |
| --title "Edge (unstable)" \ | |
| --notes "$notes" *.rpm *.*deb | |
| fi | |
| - name: Create release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release create "$GITHUB_REF_NAME" --generate-notes \ | |
| --notes-file - *.rpm *.*deb <<EOF | |
| Container image: | |
| podman run --rm --name grout \\ | |
| --device /dev/net/tun --device /dev/vfio \\ | |
| -v /dev/hugepages:/dev/hugepages \\ | |
| --cap-add NET_ADMIN,IPC_LOCK \\ | |
| quay.io/grout/grout:${GITHUB_REF_NAME#v} | |
| EOF |