setup-ko/.github/workflows/use-action.yaml

63 lines
1.4 KiB
YAML
Raw Normal View History

2021-04-27 21:41:07 +08:00
name: Use Action
on:
push:
branches:
- 'main'
2021-04-27 21:41:07 +08:00
jobs:
use-action:
name: Use Action
2021-04-29 10:56:10 +08:00
strategy:
matrix:
platform:
- ubuntu-latest
- macos-latest
2021-04-29 10:56:10 +08:00
runs-on: ${{ matrix.platform }}
2021-04-27 21:41:07 +08:00
steps:
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
2021-04-27 21:41:07 +08:00
with:
go-version: '1.22'
check-latest: 'true'
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
2021-04-27 21:41:07 +08:00
# Minimal publish
2023-01-13 05:43:19 +08:00
- uses: ko-build/setup-ko@main
2021-04-27 21:41:07 +08:00
- run: ko publish --bare ./
- name: Install old release
2023-01-13 05:43:19 +08:00
uses: ko-build/setup-ko@main
2021-04-27 21:41:07 +08:00
with:
version: v0.8.0
2021-04-27 21:41:07 +08:00
- name: Check installed version
run: ko version | grep 0.8.0
- name: Install from tip
2023-01-13 05:43:19 +08:00
uses: ko-build/setup-ko@main
2021-04-27 21:41:07 +08:00
with:
version: tip
2021-04-27 21:41:07 +08:00
- 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
2023-01-13 05:43:19 +08:00
uses: ko-build/setup-ko@main
env:
KO_DOCKER_REPO: already-set
- name: Check pre-set KO_DOCKER_REPO
run: |
2021-05-01 10:42:32 +08:00
if [[ "${KO_DOCKER_REPO}" != "already-set" ]]; then
echo "${KO_DOCKER_REPO} != already-set"
exit 1
fi