Skip to content

cli: improve generic decoders and type generation (#164) #47

cli: improve generic decoders and type generation (#164)

cli: improve generic decoders and type generation (#164) #47

Workflow file for this run

name: Release CLI on github
on:
push:
tags:
- "v*"
jobs:
tests:
uses: ./.github/workflows/test.yaml
build-cli-binaries:
name: build the CLI binaries
runs-on: ubuntu-20.04
needs: [tests]
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: build the CLI
run: |
VERSION="$GITHUB_REF_NAME" make ci-build-codegen
mkdir release
.github/scripts/plugin-manifest.sh
mv _output/* release
- uses: actions/upload-artifact@v4
with:
path: release/manifest.yaml
if-no-files-found: error
name: plugin-manifest
- uses: actions/upload-artifact@v4
with:
path: release/hasura-ndc-go-*
if-no-files-found: error
name: artifact
release:
name: release to GitHub
needs:
- build-cli-binaries
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: release/artifacts
merge-multiple: true
- name: Build connector definition
run: |
set -evo pipefail
ROOT="$(pwd)"
export VERSION=$GITHUB_REF_NAME
mkdir -p "/tmp/release/connector-definition"
chmod +x ${ROOT}/release/artifacts/hasura-ndc-go-linux-amd64
${ROOT}/release/artifacts/hasura-ndc-go-linux-amd64 new -n ndc_go -m hasura-ndc.dev/ndc-go -o /tmp/release/connector-definition
tar -czvf "${ROOT}/release/artifacts/connector-definition.tgz" --directory "/tmp/release/connector-definition/" .
- uses: actions/upload-artifact@v4
with:
name: connector-definition.tgz
path: ./release/artifacts/connector-definition.tgz
compression-level: 0 # Already compressed
- name: Get version from tag
id: get-version
run: |
echo "tagged_version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
shell: bash
- name: create a draft release
uses: ncipollo/release-action@v1
with:
draft: true
tag: v${{ steps.get-version.outputs.tagged_version }}
artifacts: release/artifacts/*