Skip to content

Commit

Permalink
only publish on release
Browse files Browse the repository at this point in the history
  • Loading branch information
dskiff committed Apr 25, 2024
1 parent 6e92113 commit 0f44d56
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 42 deletions.
42 changes: 0 additions & 42 deletions .github/workflows/publish.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ on:

permissions:
contents: write
packages: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8459bc0c7e3759cdf591f513d9f141a95fef0a8f
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7
Expand All @@ -26,3 +29,21 @@ jobs:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Use built tko for publish
run: cp ./dist/tko_linux_amd64_v1/tko /usr/local/bin/tko

- name: Publish (bin)
run: tko "./dist/tko_linux_amd64_v1"
env:
TKO_BASE_IMAGE: "scratch"
TKO_DEST_PATH: "/usr/local/bin"
TKO_TARGET_REPO: "ghcr.io/dskiff/tko:bin"
GITHUB_TOKEN: ${{ github.token }}

- name: Publish (version)
run: tko "./dist/tko_linux_amd64_v1"
env:
TKO_DEST_PATH: "/usr/local/bin"
TKO_TARGET_REPO: "ghcr.io/dskiff/tko:v${{ steps.goreleaser.outputs.version }}"
GITHUB_TOKEN: ${{ github.token }}
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ func main() {
log.Println("TKO_DEST_PATH:", TKO_DEST_PATH)
log.Println("TKO_ENTRYPOINT:", TKO_ENTRYPOINT)
log.Println("TKO_TEMP_PATH:", TKO_TEMP_PATH)
log.Println("TKO_TARGET_TYPE:", TKO_TARGET_TYPE)
log.Println("TKO_LOG_LEVEL:", TKO_LOG_LEVEL)
log.Println("Source path:", srcPath)
log.Println("")

Expand Down

0 comments on commit 0f44d56

Please sign in to comment.