|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "[0-9]+.[0-9]+.[0-9]+*" |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + |
| 11 | +env: |
| 12 | + DOCKER_REGISTRY: ghcr.io/linkerd |
| 13 | + |
| 14 | +jobs: |
| 15 | + |
| 16 | + docker-build: |
| 17 | + runs-on: ubuntu-20.04 |
| 18 | + timeout-minutes: 10 |
| 19 | + steps: |
| 20 | + - name: Checkout code |
| 21 | + uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 |
| 22 | + - name: Docker build |
| 23 | + uses: ./.github/actions/docker-build |
| 24 | + with: |
| 25 | + docker-registry: ${{ env.DOCKER_REGISTRY }} |
| 26 | + docker-tag: ${{ github.ref_name }} |
| 27 | + docker-target: linux-amd64 |
| 28 | + docker-push: 1 |
| 29 | + docker-ghcr-username: ${{ secrets.DOCKER_GHCR_USERNAME }} |
| 30 | + docker-ghcr-pat: ${{ secrets.DOCKER_GHCR_PAT }} |
| 31 | + component: failover |
| 32 | + |
| 33 | + integration-tests: |
| 34 | + runs-on: ubuntu-20.04 |
| 35 | + timeout-minutes: 10 |
| 36 | + needs: [docker-build] |
| 37 | + steps: |
| 38 | + - name: Checkout code |
| 39 | + uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 |
| 40 | + - name: Set up Helm |
| 41 | + uses: azure/setup-helm@a517f2ff6560563a369e16ca7c7d136b6164423f |
| 42 | + - name: Create cluster |
| 43 | + uses: AbsaOSS/k3d-action@5d155528f6d4a35f72c4cf3590e22fa0dde1e28a |
| 44 | + with: |
| 45 | + cluster-name: testing |
| 46 | + - name: Install linkerd |
| 47 | + run: | |
| 48 | + curl -sL https://run.linkerd.io/install-edge | sh |
| 49 | + export PATH=$PATH:~/.linkerd2/bin |
| 50 | + linkerd install | kubectl apply -f - |
| 51 | + linkerd check |
| 52 | + - name: Install linkerd-smi |
| 53 | + run: | |
| 54 | + helm repo add linkerd-smi https://linkerd.github.io/linkerd-smi |
| 55 | + helm repo up |
| 56 | + helm install linkerd-smi -n linkerd-smi --create-namespace --wait linkerd-smi/linkerd-smi |
| 57 | + - name: Install current linkerd-failover |
| 58 | + run: | |
| 59 | + helm install linkerd-failover -n linkerd-failover --create-namespace --wait \ |
| 60 | + --set image.registry=${{ env.DOCKER_REGISTRY }} \ |
| 61 | + --set image.tag=${{ github.ref_name }} \ |
| 62 | + charts/linkerd-failover |
| 63 | + - name: Test routing to primary |
| 64 | + uses: ./.github/actions/failover-test |
| 65 | + with: |
| 66 | + westReplicas: 1 |
| 67 | + westShouldReceiveTraffic: true |
| 68 | + centralReplicas: 1 |
| 69 | + centralShouldReceiveTraffic: false |
| 70 | + eastReplicas: 1 |
| 71 | + eastShouldReceiveTraffic: false |
| 72 | + - name: Test failover to secondaries |
| 73 | + uses: ./.github/actions/failover-test |
| 74 | + with: |
| 75 | + westReplicas: 0 |
| 76 | + westShouldReceiveTraffic: false |
| 77 | + centralReplicas: 1 |
| 78 | + centralShouldReceiveTraffic: true |
| 79 | + eastReplicas: 1 |
| 80 | + eastShouldReceiveTraffic: true |
| 81 | + - name: Test removal of one secondary |
| 82 | + uses: ./.github/actions/failover-test |
| 83 | + with: |
| 84 | + westReplicas: 0 |
| 85 | + westShouldReceiveTraffic: false |
| 86 | + centralReplicas: 0 |
| 87 | + centralShouldReceiveTraffic: false |
| 88 | + eastReplicas: 1 |
| 89 | + eastShouldReceiveTraffic: true |
| 90 | + - name: Test reestablishment of primary |
| 91 | + uses: ./.github/actions/failover-test |
| 92 | + with: |
| 93 | + westReplicas: 1 |
| 94 | + westShouldReceiveTraffic: true |
| 95 | + centralReplicas: 0 |
| 96 | + centralShouldReceiveTraffic: false |
| 97 | + eastReplicas: 1 |
| 98 | + eastShouldReceiveTraffic: false |
| 99 | + |
| 100 | + gh-release: |
| 101 | + name: Create GH release |
| 102 | + timeout-minutes: 10 |
| 103 | + runs-on: ubuntu-20.04 |
| 104 | + needs: [integration-tests] |
| 105 | + permissions: |
| 106 | + contents: write |
| 107 | + steps: |
| 108 | + - name: Checkout code |
| 109 | + uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 |
| 110 | + - name: Extract release notes |
| 111 | + run: | |
| 112 | + . bin/_release.sh |
| 113 | + extract_release_notes NOTES.md |
| 114 | + - name: Create release |
| 115 | + id: create_release |
| 116 | + uses: softprops/action-gh-release@fb0163a75bee697a9cfec2c931801de7c7f10042 |
| 117 | + with: |
| 118 | + draft: false |
| 119 | + prerelease: false |
| 120 | + body_path: NOTES.md |
| 121 | + |
| 122 | + chart-deploy: |
| 123 | + name: Helm chart deploy |
| 124 | + timeout-minutes: 10 |
| 125 | + runs-on: ubuntu-20.04 |
| 126 | + needs: [gh-release] |
| 127 | + steps: |
| 128 | + - name: Checkout code |
| 129 | + uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 |
| 130 | + - name: Set up Helm |
| 131 | + uses: azure/setup-helm@a517f2ff6560563a369e16ca7c7d136b6164423f |
| 132 | + - name: Log into GCP |
| 133 | + uses: 'google-github-actions/auth@8d125895b958610ec414ca4dae010257eaa814d3' |
| 134 | + with: |
| 135 | + credentials_json: ${{ secrets.LINKERD_SITE_TOKEN }} |
| 136 | + - name: Helm chart creation and upload |
| 137 | + run: | |
| 138 | + mkdir -p target/helm |
| 139 | + helm --app-version "${{ github.ref_name }}" -d target/helm package charts/linkerd-failover |
| 140 | + # backup index file before changing it |
| 141 | + gsutil cp gs://helm.linkerd.io/edge/index.yaml "target/helm/index-pre-failover-${{ github.ref_name }}".yaml |
| 142 | + helm repo index --url https://helm.linkerd.io/edge/ --merge "target/helm/index-pre-failover-${{ github.ref_name }}".yaml target/helm |
| 143 | + gsutil rsync target/helm gs://helm.linkerd.io/edge |
0 commit comments