1
0
mirror of https://github.com/rancher/cli.git synced 2026-02-05 18:48:50 +01:00
Files
cli/.github/workflows/ci.yml
renovate-rancher[bot] cac8ee1887 Update GitHub Actions
2025-12-08 06:44:37 +00:00

59 lines
1.3 KiB
YAML

name: CI
on:
workflow_dispatch:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
with:
go-version-file: go.mod
cache: false
- name: Lint
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8
- name: Validate Go modules
run: ./scripts/validate
- name: Test
run: ./scripts/test
- name: Get Tag
if: startsWith(github.ref, 'refs/tags/v')
run: echo "GITHUB_TAG=$GITHUB_REF_NAME" >> $GITHUB_ENV
- name: Build
env:
CROSS: 1
run: ./scripts/build
- name: Package
run: |
./scripts/package
ls -lR dist/artifacts
# Stage binary for packaging step
cp -r ./bin/* ./package/
# Export the tag for the next step
source ./scripts/version
echo "VERSION=$VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Docker Build
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6
with:
push: false
context: package
tags: rancher/cli2:${{ env.VERSION }}