2021-04-27 21:41:07 +08:00
|
|
|
name: Use Action
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-07-11 17:36:11 +08:00
|
|
|
branches:
|
|
|
|
- 'main'
|
2021-04-27 21:41:07 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
use-action:
|
|
|
|
name: Use Action
|
2023-07-11 17:36:11 +08:00
|
|
|
|
2021-04-29 10:56:10 +08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-07-11 17:36:11 +08:00
|
|
|
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:
|
2023-07-11 17:36:11 +08:00
|
|
|
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
|
2021-04-27 21:41:07 +08:00
|
|
|
with:
|
2023-07-11 17:36:11 +08:00
|
|
|
go-version: '1.20'
|
|
|
|
check-latest: 'true'
|
|
|
|
|
2023-10-18 01:10:11 +08:00
|
|
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2021-04-27 21:41:07 +08:00
|
|
|
|
|
|
|
# Minimal publish
|
2023-01-13 05:43:19 +08:00
|
|
|
- uses: ko-build/setup-ko@main
|
2023-07-11 17:36:11 +08:00
|
|
|
|
2021-04-27 21:41:07 +08:00
|
|
|
- run: ko publish --bare ./
|
|
|
|
|
2021-05-01 10:33:35 +08:00
|
|
|
- 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
|
2023-07-11 17:36:11 +08:00
|
|
|
|
2021-04-27 21:41:07 +08:00
|
|
|
- name: Check installed version
|
|
|
|
run: ko version | grep 0.8.0
|
|
|
|
|
2021-05-01 10:33:35 +08:00
|
|
|
- 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
|
2023-07-11 17:36:11 +08:00
|
|
|
|
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
|
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
|
2023-01-13 05:43:19 +08:00
|
|
|
uses: ko-build/setup-ko@main
|
2021-05-01 10:33:35 +08:00
|
|
|
env:
|
|
|
|
KO_DOCKER_REPO: already-set
|
2023-07-11 17:36:11 +08:00
|
|
|
|
2021-05-01 10:33:35 +08:00
|
|
|
- name: Check pre-set KO_DOCKER_REPO
|
|
|
|
run: |
|
2021-05-01 10:42:32 +08:00
|
|
|
if [[ "${KO_DOCKER_REPO}" != "already-set" ]]; then
|
2021-05-01 10:33:35 +08:00
|
|
|
echo "${KO_DOCKER_REPO} != already-set"
|
|
|
|
exit 1
|
|
|
|
fi
|