Skip to content

Commit 276d9c8

Browse files
committed
add dependabot config, ci job and general cleanup
Signed-off-by: cpanato <[email protected]>
1 parent c03345c commit 276d9c8

File tree

6 files changed

+103
-15
lines changed

6 files changed

+103
-15
lines changed

.github/dependabot.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
version: 2
3+
updates:
4+
- package-ecosystem: gomod
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
8+
open-pull-requests-limit: 10
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "daily"
13+
open-pull-requests-limit: 10

.github/workflows/ci.yaml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Use Action
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
use-action:
8+
name: Use Action
9+
10+
strategy:
11+
matrix:
12+
platform:
13+
- ubuntu-latest
14+
- macos-latest
15+
16+
runs-on: ${{ matrix.platform }}
17+
18+
steps:
19+
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
20+
with:
21+
go-version: '1.20'
22+
check-latest: 'true'
23+
24+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
25+
26+
# Minimal publish
27+
- uses: ./
28+
29+
- run: ko publish --bare ./
30+
if: ${{ github.event_name == 'pull_request' }}
31+
env:
32+
KO_DOCKER_REPO: ko.local
33+
34+
- name: Install old release
35+
uses: ./
36+
with:
37+
version: v0.8.0
38+
39+
- name: Check installed version
40+
run: ko version | grep 0.8.0
41+
42+
- name: Install from tip
43+
uses: ./
44+
with:
45+
version: tip
46+
47+
- name: Check installed version (tip)
48+
run: |
49+
sudo rm /usr/local/bin/ko # Uninstall previous versions.
50+
ko version
51+
52+
# If KO_DOCKER_REPO is set during setup, it's set for future steps.
53+
- name: Pre-set KO_DOCKER_REPO
54+
uses: ./
55+
env:
56+
KO_DOCKER_REPO: already-set
57+
58+
- name: Check pre-set KO_DOCKER_REPO
59+
run: |
60+
if [[ "${KO_DOCKER_REPO}" != "already-set" ]]; then
61+
echo "${KO_DOCKER_REPO} != already-set"
62+
exit 1
63+
fi

.github/workflows/use-action.yaml

+16-5
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,47 @@ name: Use Action
22

33
on:
44
push:
5-
branches: ['main']
5+
branches:
6+
- 'main'
67

78
jobs:
89
use-action:
910
name: Use Action
11+
1012
strategy:
1113
matrix:
12-
platform: [ubuntu-latest, macos-latest]
14+
platform:
15+
- ubuntu-latest
16+
- macos-latest
17+
1318
runs-on: ${{ matrix.platform }}
1419

1520
steps:
16-
- uses: actions/setup-go@v2
21+
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
1722
with:
18-
go-version: 1.18
19-
- uses: actions/checkout@v2
23+
go-version: '1.20'
24+
check-latest: 'true'
25+
26+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2027

2128
# Minimal publish
2229
- uses: ko-build/setup-ko@main
30+
2331
- run: ko publish --bare ./
2432

2533
- name: Install old release
2634
uses: ko-build/setup-ko@main
2735
with:
2836
version: v0.8.0
37+
2938
- name: Check installed version
3039
run: ko version | grep 0.8.0
3140

3241
- name: Install from tip
3342
uses: ko-build/setup-ko@main
3443
with:
3544
version: tip
45+
3646
- name: Check installed version (tip)
3747
run: |
3848
sudo rm /usr/local/bin/ko # Uninstall previous versions.
@@ -43,6 +53,7 @@ jobs:
4353
uses: ko-build/setup-ko@main
4454
env:
4555
KO_DOCKER_REPO: already-set
56+
4657
- name: Check pre-set KO_DOCKER_REPO
4758
run: |
4859
if [[ "${KO_DOCKER_REPO}" != "already-set" ]]; then

README.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Build](https://github.com/ko-build/setup-ko/actions/workflows/use-action.yaml/badge.svg)](https://github.com/ko-build/setup-ko/actions/workflows/use-action.yaml)
44

55
> :warning: Note: `ko` recently [moved to its own GitHub org](https://github.com/ko-build/ko/issues/791), which broke `[email protected]` if the `ko` version wasn't specified.
6-
>
6+
>
77
> To fix this, either upgrade to [`[email protected]`](https://github.com/ko-build/setup-ko/releases/tag/v0.6) or specify `version`
88
99
## Example usage
@@ -20,10 +20,10 @@ jobs:
2020
name: Publish
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/setup-go@v2
23+
- uses: actions/setup-go@v4
2424
with:
2525
go-version: '1.20.x'
26-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v3
2727

2828
- uses: ko-build/[email protected]
2929
- run: ko build
@@ -47,7 +47,7 @@ You can select a version with the `version` parameter:
4747
```yaml
4848
- uses: ko-build/[email protected]
4949
with:
50-
version: v0.11.2
50+
version: v0.14.1
5151
```
5252

5353
To build and install `ko` from source using `go install`, specify `version: tip`.
@@ -86,17 +86,18 @@ name: Publish Release YAML
8686
8787
on:
8888
release:
89-
types: ['created']
89+
types:
90+
- 'created'
9091
9192
jobs:
9293
publish-release-yaml:
9394
name: Publish Release YAML
9495
runs-on: ubuntu-latest
9596
steps:
96-
- uses: actions/setup-go@v2
97+
- uses: actions/setup-go@v4
9798
with:
98-
go-version: '1.20.x'
99-
- uses: actions/checkout@v2
99+
go-version: '1.20'
100+
- uses: actions/checkout@v3
100101
- uses: ko-build/[email protected]
101102
102103
- name: Generate and upload release.yaml

action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ branding:
55
color: green
66
inputs:
77
version:
8-
description: 'Version of ko to install (tip, latest-release, v0.8.2, etc.)'
8+
description: 'Version of ko to install (tip, latest-release, v0.14.1, etc.)'
99
required: true
1010
default: 'latest-release'
1111
runs:

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/ko-build/setup-ko
22

3-
go 1.16
3+
go 1.20

0 commit comments

Comments
 (0)