Skip to content

workflow OCI builds #10

workflow OCI builds

workflow OCI builds #10

Workflow file for this run

name: Release builds
on:
push:
tags:
- '*'
permissions:
contents: write
packages: write
jobs:
release-linux-amd64:
name: release linux/amd64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set APP_VERSION env
run: echo APP_VERSION=$(echo ${GITHUB_REF} | rev | cut -d'/' -f 1 | rev ) >> ${GITHUB_ENV}
- uses: ncipollo/release-action@v1
with:
tag: ${{ vars.GITHUB_REF_NAME }}
skipIfReleaseExists: true
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: linux
goarch: amd64
project_path: "./cmd/kndp"
binary_name: "kndp"
ldflags: -X "main.Version=${{ env.APP_VERSION }}"
oci-builds:
name: build OCI images
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.21.4'
- uses: actions/checkout@v4
- name: Set APP_VERSION env
run: echo APP_VERSION=$(echo ${GITHUB_REF} | rev | cut -d'/' -f 1 | rev ) >> ${GITHUB_ENV}
- uses: ko-build/[email protected]
env:
KO_DOCKER_REPO: ghcr.io/kndpio/cli
- name: build
env:
auth_token: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ env.APP_VERSION }}
run: |
echo "${auth_token}" | ko login ghcr.io --username KNDP --password-stdin
ko build ./cmd/kndp/ --tags=${{ env.VERSION }} --bare