chore(deps): update actions/download-artifact action to v4 #532
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: CI Pipeline | |
on: | |
push: | |
paths-ignore: | |
- README.md | |
branches: | |
- "**" | |
tags-ignore: | |
- build-refs** | |
pull_request: | |
env: | |
HUB_VERSION: 2.12.7 | |
HUB_OS: darwin | |
HUB_ARCH: amd64 | |
jobs: | |
release-name: | |
name: Generate a release name to use | |
runs-on: ubuntu-latest | |
env: | |
HUB_OS: linux | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
if: github.event_name == 'push' | |
- run: echo $GITHUB_REF | sed -e 's/^refs\///g' -e 's/^tags\///g' > VERSION | |
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 | |
with: | |
name: VERSION | |
path: VERSION | |
- name: fetch hub | |
if: github.event_name == 'push' | |
run: wget -q -c https://github.com/github/hub/releases/download/v${HUB_VERSION}/hub-${HUB_OS}-${HUB_ARCH}-${HUB_VERSION}.tgz -O - | tar -xz | |
- name: create pre-release if it doesn't exist | |
if: github.event_name == 'push' | |
run: hub-${HUB_OS}-${HUB_ARCH}-${HUB_VERSION}/bin/hub release create -m "$(cat VERSION)" "$(cat VERSION)" || echo release already exists | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# golangci-lint: | |
# name: GolangCI | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/[email protected] | |
# - uses: docker://golangci/golangci-lint | |
# with: | |
# args: golangci-lint run --color=always | |
test-build-publish: | |
name: Test and Build | |
runs-on: macOS-latest | |
needs: release-name | |
strategy: | |
fail-fast: false | |
max-parallel: 8 | |
matrix: | |
OS: | |
- darwin | |
- linux | |
- windows | |
- netbsd | |
- freebsd | |
- openbsd | |
- plan9 | |
- solaris | |
ARCH: | |
- amd64 | |
- 386 | |
- arm64 | |
- arm | |
include: | |
- OS: windows | |
EXT: .exe | |
exclude: | |
- OS: darwin | |
ARCH: 386 | |
- OS: darwin | |
ARCH: arm | |
- OS: windows | |
ARCH: arm64 | |
- OS: freebsd | |
ARCH: arm64 | |
- OS: plan9 | |
ARCH: arm64 | |
- OS: solaris | |
ARCH: arm64 | |
- OS: solaris | |
ARCH: arm | |
- OS: solaris | |
ARCH: 386 | |
env: | |
BUILD_FILENAME: kubectl-passman-${{matrix.OS}}-${{matrix.ARCH}}${{matrix.EXT}} | |
ZIP_FILENAME: kubectl-passman-${{matrix.OS}}-${{matrix.ARCH}}.zip | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- run: go test -v | |
- uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0 | |
with: | |
name: VERSION | |
path: VERSION | |
- run: go build -a -ldflags "-X main.VERSION=$(cat VERSION/VERSION)" -o ${BUILD_FILENAME} | |
env: | |
GOOS: ${{matrix.OS}} | |
GOARCH: ${{matrix.ARCH}} | |
- run: chmod +x ${BUILD_FILENAME} | |
env: | |
GOOS: ${{matrix.OS}} | |
GOARCH: ${{matrix.ARCH}} | |
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 | |
with: | |
name: kubectl-passman-${{matrix.OS}}-${{matrix.ARCH}}${{matrix.EXT}} | |
path: kubectl-passman-${{matrix.OS}}-${{matrix.ARCH}}${{matrix.EXT}} | |
- uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0 | |
with: | |
name: VERSION | |
path: VERSION | |
- run: zip kubectl-passman-${{matrix.OS}}-${{matrix.ARCH}}.zip ${BUILD_FILENAME} LICENSE | |
- name: fetch hub | |
if: github.event_name == 'push' | |
run: wget -q -c https://github.com/github/hub/releases/download/v${HUB_VERSION}/hub-${HUB_OS}-${HUB_ARCH}-${HUB_VERSION}.tgz -O - | tar -xz | |
- name: Publish to release | |
if: github.event_name == 'push' | |
run: | | |
hub-${HUB_OS}-${HUB_ARCH}-${HUB_VERSION}/bin/hub release edit -a ${ZIP_FILENAME} -m "Latest build of ${{github.ref}}" "$(cat VERSION/VERSION)" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
write-krew: | |
name: Write krew manifest file | |
runs-on: ubuntu-latest | |
if: github.ref_type == 'tag' | |
env: | |
HUB_OS: linux | |
needs: | |
- test-build-publish | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Update new version in krew-index | |
uses: rajatjindal/krew-release-bot@df3eb197549e3568be8b4767eec31c5e8e8e6ad8 # v0.0.46 |