Merge pull request #192 from kndpio/28-environment-composition #45
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release builds | |
on: | |
push: | |
tags: | |
- '*' | |
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 | |
env: | |
REGISTRY: ghcr.io/kndpio/cli | |
steps: | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21.4' | |
- uses: actions/checkout@v4 | |
- name: Set VERSION env | |
run: echo VERSION=$(echo ${GITHUB_REF} | rev | cut -d'/' -f 1 | rev ) >> ${GITHUB_ENV} | |
- name: Set OCI_DOMAIN env | |
run: echo OCI_DOMAIN=$(echo ${REGISTRY} | cut -d'/' -f 1 ) >> ${GITHUB_ENV} | |
- uses: ko-build/[email protected] | |
env: | |
KO_DOCKER_REPO: ${{ env.REGISTRY }} | |
- name: Run ko build | |
env: | |
auth_token: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "${auth_token}" | ko login ${{ env.OCI_DOMAIN }} --username ${{ github.actor }} --password-stdin | |
ko build ./cmd/kndp/ --tags=${{ env.VERSION }} --bare | |
- name: Install crossplane CLI | |
id: crossplane | |
run: curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh" | sh | |
- name: Build and push crossplane packages | |
run: ./crossplane xpkg build -f package -o configuration-environment && ./crossplane xpkg push -f configuration-environment ${REGISTRY}/${{ github.repository }}/configuration-environment:${{ env.VERSION }} || true' || true; |