Update release.yaml #81
Workflow file for this run
This file contains 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: | |
- '*' | |
jobs: | |
goreleaser: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2.3.4 | |
- name: Unshallow | |
run: git fetch --prune --unshallow | |
- name: Set up Go | |
uses: actions/setup-go@v2.1.3 | |
with: | |
go-version: 1.23.3 | |
- name: Upgrade upx | |
run: | | |
# try to fix https://github.com/jenkins-zh/jenkins-cli/issues/493 | |
wget https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz | |
tar xvf upx-3.96-amd64_linux.tar.xz | |
upx-3.96-amd64_linux/upx -V | |
sudo mv upx-3.96-amd64_linux/upx $(which upx) | |
rm -rf upx-3.96-amd64_linux | |
rm -rf xvf upx-3.96-amd64_linux.tar.xz | |
upx -V | |
- name: Image Registry Login | |
run: | | |
docker login --username ${{ secrets.DOCKER_HUB_USER }} --password ${{secrets.DOCKER_HUB_TOKEN}} | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v3 | |
with: | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PUBLISH_SECRETS }} | |
- name: Build image | |
run: | | |
ver=$(git describe --tags) | |
cp bin/ks_linux_amd64_v1/ks build/ks | |
docker build ./build -t kubespheredev/ks-tool:v1.17.0-${ver} | |
docker push kubespheredev/ks-tool:v1.17.0-${ver} | |
docker tag kubespheredev/ks-tool:v1.17.0-${ver} kubespheredev/ks-tool:latest | |
docker push kubespheredev/ks-tool:latest |