-
Notifications
You must be signed in to change notification settings - Fork 5
57 lines (53 loc) · 1.93 KB
/
releases.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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;