bump publish image action to 24f67e54a70313c324a9d5b901f722a2f77b36d8… #8
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
| name: release | |
| on: | |
| push: | |
| tags: | |
| - "v*-test" | |
| env: | |
| TAG: ${{ github.ref_name }} | |
| GHCR_REGISTRY: ghcr.io | |
| DOCKERHUB_REGISTRY: docker.io | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| actions: read | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set test credentials | |
| run: | | |
| echo "PRIME_REGISTRY=ghcr.io" >> $GITHUB_ENV | |
| echo "PRIME_REGISTRY_USERNAME=furkatgofurov7" >> $GITHUB_ENV | |
| echo "PRIME_REGISTRY_PASSWORD=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | |
| - name: Push bootstrap image to DockerHub | |
| uses: rancher/ecm-distro-tools/actions/publish-image@df88359100d76a6d1d6ba91fae417d9afca7da48 | |
| with: | |
| image: cluster-api-provider-rke2-bootstrap | |
| tag: ${{ env.TAG }} | |
| platforms: linux/amd64,linux/arm64 | |
| push-to-prime: false | |
| public-registry: ${{ env.DOCKERHUB_REGISTRY }} | |
| public-repo: furkat007 | |
| public-username: furkat007 | |
| public-password: ${{ secrets.DOCKER_PASSWORD }} | |
| make-target: push-rke2-bootstrap-image | |
| - name: Push controlplane image to DockerHub | |
| uses: rancher/ecm-distro-tools/actions/publish-image@df88359100d76a6d1d6ba91fae417d9afca7da48 | |
| with: | |
| image: cluster-api-provider-rke2-controlplane | |
| tag: ${{ env.TAG }} | |
| platforms: linux/amd64,linux/arm64 | |
| push-to-prime: false | |
| public-registry: ${{ env.DOCKERHUB_REGISTRY }} | |
| public-repo: furkat007 | |
| public-username: furkat007 | |
| public-password: ${{ secrets.DOCKER_PASSWORD }} | |
| make-target: push-rke2-controlplane-image | |
| - name: Push bootstrap image to prime registry | |
| uses: rancher/ecm-distro-tools/actions/publish-image@df88359100d76a6d1d6ba91fae417d9afca7da48 | |
| with: | |
| image: cluster-api-provider-rke2-bootstrap | |
| tag: ${{ env.TAG }} | |
| platforms: linux/amd64,linux/arm64 | |
| push-to-public: false | |
| prime-repo: furkatgofurov7 | |
| prime-registry: ${{ env.PRIME_REGISTRY }} | |
| prime-username: ${{ env.PRIME_REGISTRY_USERNAME }} | |
| prime-password: ${{ env.PRIME_REGISTRY_PASSWORD }} | |
| prime-make-target: push-prime-rke2-bootstrap-image | |
| - name: Push controlplane image to prime registry | |
| uses: rancher/ecm-distro-tools/actions/publish-image@df88359100d76a6d1d6ba91fae417d9afca7da48 | |
| with: | |
| image: cluster-api-provider-rke2-controlplane | |
| tag: ${{ env.TAG }} | |
| platforms: linux/amd64,linux/arm64 | |
| push-to-public: false | |
| prime-repo: furkatgofurov7 | |
| prime-registry: ${{ env.PRIME_REGISTRY }} | |
| prime-username: ${{ env.PRIME_REGISTRY_USERNAME }} | |
| prime-password: ${{ env.PRIME_REGISTRY_PASSWORD }} | |
| prime-make-target: push-prime-rke2-controlplane-image | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| needs: [build] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: setupGo | |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Set test credentials | |
| run: | | |
| echo "PRIME_REGISTRY=docker.io" >> $GITHUB_ENV | |
| echo "PRIME_REGISTRY_USERNAME=furkat007" >> $GITHUB_ENV | |
| echo "PRIME_REGISTRY_PASSWORD=${{ secrets.DOCKER_PASSWORD }}" >> $GITHUB_ENV | |
| - name: Update manifests | |
| run: | | |
| make release RELEASE_TAG=${{ env.TAG }} REGISTRY=${{ env.GHCR_REGISTRY }} | |
| - name: Package and publish release manifests as OCI artifacts | |
| env: | |
| ORAS_VERSION: 1.2.3 | |
| ARTIFACT_NAME: ${{ env.PRIME_REGISTRY }}/furkatgofurov7/cluster-api-provider-rke2-components | |
| REGISTRY_PASSWORD: ${{ env.PRIME_REGISTRY_PASSWORD }} | |
| REGISTRY_USERNAME: ${{ env.PRIME_REGISTRY_USERNAME }} | |
| REGISTRY_HOST: ${{ env.PRIME_REGISTRY }} | |
| run: | | |
| set -e | |
| # Install oras | |
| (type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \ | |
| && wget -q https://github.com/oras-project/oras/releases/download/v${ORAS_VERSION}/oras_${ORAS_VERSION}_linux_amd64.tar.gz \ | |
| && tar -xzf oras_${ORAS_VERSION}_linux_amd64.tar.gz \ | |
| && sudo install -D -m 755 oras /usr/local/bin/ | |
| echo "Authenticating with registry..." | |
| echo "${REGISTRY_PASSWORD}" | oras login "${REGISTRY_HOST}" --username "${REGISTRY_USERNAME}" --password-stdin | |
| cd out | |
| echo "Pushing artifacts to registry: ${ARTIFACT_NAME}:${{ env.TAG }}" | |
| echo "Files in out directory:" | |
| ls -la | |
| FILES_TO_PUSH="metadata.yaml bootstrap-components.yaml control-plane-components.yaml" | |
| MISSING_FILES="" | |
| for file in $FILES_TO_PUSH; do | |
| if [ ! -f "$file" ]; then | |
| MISSING_FILES="$MISSING_FILES $file" | |
| fi | |
| done | |
| if [ -n "$MISSING_FILES" ]; then | |
| echo "ERROR: Missing files:$MISSING_FILES" | |
| exit 1 | |
| fi | |
| if oras push "${ARTIFACT_NAME}:${{ env.TAG }}" $FILES_TO_PUSH; then | |
| echo "Successfully pushed artifacts" | |
| else | |
| echo "ERROR: Failed to push artifacts" | |
| exit 1 | |
| fi | |
| - name: Create draft release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release create ${{ env.TAG }} --draft --generate-notes | |
| - name: Upload release assets | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release upload ${{ env.TAG }} out/metadata.yaml | |
| gh release upload ${{ env.TAG }} out/bootstrap-components.yaml | |
| gh release upload ${{ env.TAG }} out/control-plane-components.yaml | |
| - name: Publish release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: gh release edit ${{ env.TAG }} --draft=false --latest=false |