2021-04-27 21:41:07 +08:00
|
|
|
name: Use Action
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: ['main']
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
use-action:
|
|
|
|
name: Use Action
|
2021-04-29 10:56:10 +08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
platform: [ubuntu-latest, macos-latest]
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
|
2021-04-27 21:41:07 +08:00
|
|
|
steps:
|
|
|
|
- uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: 1.16
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
# Minimal publish
|
2021-04-30 23:06:59 +08:00
|
|
|
- uses: imjasonh/setup-ko@main
|
2021-04-27 21:41:07 +08:00
|
|
|
- run: ko publish --bare ./
|
|
|
|
|
2021-05-01 10:33:35 +08:00
|
|
|
- name: Install old release
|
|
|
|
uses: imjasonh/setup-ko@main
|
2021-04-27 21:41:07 +08:00
|
|
|
with:
|
|
|
|
version: v0.8.0
|
|
|
|
- name: Check installed version
|
|
|
|
run: ko version | grep 0.8.0
|
|
|
|
|
2021-05-01 10:33:35 +08:00
|
|
|
- name: Install from tip
|
|
|
|
uses: imjasonh/setup-ko@main
|
2021-04-27 21:41:07 +08:00
|
|
|
with:
|
|
|
|
version: tip
|
|
|
|
- name: Check installed version (tip)
|
|
|
|
run: |
|
|
|
|
sudo rm /usr/local/bin/ko # Uninstall previous versions.
|
|
|
|
ko version
|
2021-05-01 10:33:35 +08:00
|
|
|
|
|
|
|
# If KO_DOCKER_REPO is set during setup, it's set for future steps.
|
|
|
|
- name: Pre-set KO_DOCKER_REPO
|
|
|
|
uses: imjasonh/setup-ko@main
|
|
|
|
env:
|
|
|
|
KO_DOCKER_REPO: already-set
|
|
|
|
- name: Check pre-set KO_DOCKER_REPO
|
|
|
|
run: |
|
|
|
|
if [[ ${KO_DOCKER_REPO} -ne "already-set"]]; then
|
|
|
|
echo "${KO_DOCKER_REPO} != already-set"
|
|
|
|
exit 1
|
|
|
|
fi
|