Fix path and variable reference for NodeLocalDNS #53
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: BuildReleaser | |
| on: | |
| push: | |
| tags: | |
| - 'v4*' | |
| jobs: | |
| goreleaser: | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'kubesphere/kubekey' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Prepare | |
| id: prepare | |
| run: | | |
| LDFLAGS=$(bash hack/version.sh) | |
| VERSION=latest | |
| if [[ $GITHUB_REF == refs/tags/* ]]; then | |
| VERSION=${GITHUB_REF#refs/tags/} | |
| fi | |
| echo "ldflags=${LDFLAGS}" >> "$GITHUB_OUTPUT" | |
| echo "version=${VERSION}" >> "$GITHUB_OUTPUT" | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: 1.23.3 | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| distribution: goreleaser | |
| version: v2.5.1 | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| LDFLAGS: ${{ steps.prepare.outputs.ldflags }} | |
| - name: Upload Extra File | |
| run: | | |
| TAG=${{ steps.prepare.outputs.version }} | |
| if [[ $TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| REGISTRY=docker.io/kubesphere TAG=$TAG make generate | |
| else | |
| REGISTRY=docker.io/kubespheredev TAG=$TAG make generate | |
| fi | |
| sed -i "s/^LATEST_VERSION=.*/LATEST_VERSION=${TAG}/" hack/downloadKubekey.sh | |
| json_data=$(gh release list --limit 1 --repo kubesphere/web-installer --json name) | |
| tag_name=$(echo $json_data | jq -r '.[0].name') | |
| sed -i "s/^LATEST_WEB_INSTALLER_VERSION=.*/LATEST_WEB_INSTALLER_VERSION=${tag_name}/" hack/downloadKubekey.sh | |
| gh release upload "$TAG" config/capkk/release/* --clobber | |
| gh release upload "$TAG" hack/downloadKubekey.sh --clobber | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.ADMIN_GH_TOKEN }} | |
| - name: Synchronize artifacts to OSS | |
| run: | | |
| # Check if the current Git reference is a valid semantic version tag (e.g., v1.2.3) | |
| if [[ ! ${GITHUB_REF#refs/*/} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| echo "Skipping artifact synchronization: not a release tag." | |
| return 0 | |
| fi | |
| rm -rf qsctl_v2.4.3_linux_amd64.tar.gz | |
| wget https://attack-on-titan.gd2.qingstor.com/qsctl/v2.4.3/qsctl_v2.4.3_linux_amd64.tar.gz | |
| tar -zxvf qsctl_v2.4.3_linux_amd64.tar.gz | |
| rm -rf qsctl_v2.4.3_linux_amd64.tar.gz | |
| mv qsctl_v2.4.3_linux_amd64 /usr/local/bin/qsctl | |
| echo "access_key_id: ${{secrets.KS_QSCTL_ACCESS_KEY_ID}}" > qsctl-config.yaml | |
| echo "secret_access_key: ${{ secrets.KS_QSCTL_SECRET_ACCESS_KEY }}" >> qsctl-config.yaml | |
| qsctl -c qsctl-config.yaml cp dist/kubekey-${{ steps.prepare.outputs.version }}-linux-amd64.tar.gz qs://kubekey/github.com/kubesphere/kubekey/releases/download/${{ steps.prepare.outputs.version }}/kubekey-${{ steps.prepare.outputs.version }}-linux-amd64.tar.gz | |
| qsctl -c qsctl-config.yaml cp dist/kubekey-${{ steps.prepare.outputs.version }}-linux-arm64.tar.gz qs://kubekey/github.com/kubesphere/kubekey/releases/download/${{ steps.prepare.outputs.version }}/kubekey-${{ steps.prepare.outputs.version }}-linux-arm64.tar.gz | |
| rm -rf qsctl-config.yaml |