Pre-release v0.14.0-rc.1 #6
Workflow file for this run
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
| --- | |
| # yamllint disable rule:line-length | |
| name: publish assets after release | |
| on: # yamllint disable-line rule:truthy | |
| release: | |
| types: [published] # triggers on release and pre-release | |
| workflow_dispatch: # Useful for testing, but not necessary | |
| permissions: | |
| contents: write | |
| env: | |
| GO_VERSION: "1.24" | |
| KUBECTL_VERSION: "1.32.2" | |
| KUBECONFIG: /tmp/kubeconfig | |
| jobs: | |
| # Future - could also publish helm charts for any release (pre-release or release) | |
| #publish-helm-charts: | |
| attach-kubectl-volsync: | |
| name: Build kubectl-volsync asset attach to release | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-24.04, ubuntu-24.04-arm] | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| ref: ${{github.event.release.tag_name}} | |
| # Fetch whole history so we can properly determine the version string | |
| # (required by krew validation) | |
| fetch-depth: 0 | |
| - name: Determine architecture | |
| id: arch | |
| run: | | |
| ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" | |
| echo "ARCH=$ARCH" >> $GITHUB_ENV | |
| - name: Install Go | |
| uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Install kubectl | |
| run: | | |
| curl -fsSLO "https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/${{ env.ARCH }}/kubectl" | |
| sudo install ./kubectl /usr/local/bin/ | |
| kubectl version --client | |
| kubectl version --client | grep -q ${KUBECTL_VERSION} | |
| - name: Install krew | |
| # https://krew.sigs.k8s.io/docs/user-guide/setup/install/ | |
| run: | | |
| cd "$(mktemp -d)" | |
| OS="$(uname | tr '[:upper:]' '[:lower:]')" | |
| KREW="krew-${OS}_${{ env.ARCH }}" | |
| curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" | |
| tar zxvf "${KREW}.tar.gz" | |
| ./"${KREW}" install krew | |
| echo "${KREW_ROOT:-$HOME/.krew}/bin" >> $GITHUB_PATH | |
| - name: Test build/install of plugin via krew | |
| run: make test-krew # Will build the plugin and output to bin/kubectl-volsync.tar.gz | |
| - name: Attach kubectl-volsync asset to release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| cp bin/kubectl-volsync.tar.gz bin/kubectl-volsync-linux-${{ env.ARCH }}.tar.gz | |
| gh release upload ${{github.event.release.tag_name}} bin/kubectl-volsync-linux-${{ env.ARCH }}.tar.gz | |
| publish-kubectl-volsync: | |
| name: open PR in krew-index for kubectl-volsync | |
| needs: [attach-kubectl-volsync] | |
| runs-on: ubuntu-24.04 | |
| if: "!github.event.release.prerelease" | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| ref: ${{github.event.release.tag_name}} | |
| - name: Install Go | |
| uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Update new version in krew-index | |
| uses: rajatjindal/krew-release-bot@3d9faef30a82761d610544f62afddca00993eef9 # v0.0.47 |