Merge pull request #24 from ko-build/dependabot/github_actions/all-b9… #47
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: Use Action | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
use-action: | |
name: Use Action | |
strategy: | |
matrix: | |
platform: | |
- ubuntu-latest | |
- macos-latest | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | |
with: | |
go-version: '1.22' | |
check-latest: 'true' | |
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
# Minimal publish | |
- uses: ko-build/setup-ko@main | |
- run: ko publish --bare ./ | |
- name: Install old release | |
uses: ko-build/setup-ko@main | |
with: | |
version: v0.8.0 | |
- name: Check installed version | |
run: ko version | grep 0.8.0 | |
- name: Install from tip | |
uses: ko-build/setup-ko@main | |
with: | |
version: tip | |
- name: Check installed version (tip) | |
run: | | |
sudo rm /usr/local/bin/ko # Uninstall previous versions. | |
ko version | |
# If KO_DOCKER_REPO is set during setup, it's set for future steps. | |
- name: Pre-set KO_DOCKER_REPO | |
uses: ko-build/setup-ko@main | |
env: | |
KO_DOCKER_REPO: already-set | |
- name: Check pre-set KO_DOCKER_REPO | |
run: | | |
if [[ "${KO_DOCKER_REPO}" != "already-set" ]]; then | |
echo "${KO_DOCKER_REPO} != already-set" | |
exit 1 | |
fi |