diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a6920252..72367688 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -68,9 +68,13 @@ jobs: run: nix run .#publish-docker-image ${{ github.ref }} connector-definition: + # For now, only run on tagged releases because main builds generate a Docker image tag name that + # is not easily accessible here + # if: ${{ startsWith(github.ref, 'refs/tags/v') }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Build connector definition run: | set -e pipefail @@ -78,6 +82,7 @@ jobs: export CLI_VERSION=$GITHUB_REF_NAME make build working-directory: ./connector-definition + - uses: actions/upload-artifact@v4 with: name: connector-definition.tgz @@ -170,4 +175,56 @@ jobs: name: hasura-mongodb-${{ matrix.target }}${{ matrix.extension }} path: release if-no-files-found: error - \ No newline at end of file + + release: + name: release to GitHub + needs: + # - docker + - connector-definition + - 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: generate SHA-256 checksums + run: | + cd release/artifacts + sha256sum * > ./sha256sum + cat ./sha256sum + + - name: generate CLI manifest + run: | + export VERSION="$GITHUB_REF_NAME" + ./scripts/generate-manifest.sh + + - uses: actions/upload-artifact@v4 + with: + name: manifest.yaml + path: release + if-no-files-found: error + + - name: Get version from tag + id: get-version + run: | + echo "tagged_version=0.1.0" >> $GITHUB_OUTPUT + shell: bash + + - uses: mindsers/changelog-reader-action@v2 + id: changelog-reader + with: + version: ${{ steps.get-version.outputs.tagged_version }} + path: ./CHANGELOG.md + + - name: create a draft release + uses: ncipollo/release-action@v1 + with: + draft: true + tag: v${{ steps.get-version.outputs.tagged_version }} + body: ${{ steps.changelog-reader.outputs.changes }} + artifacts: release/artifacts/* \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..0e9fb0ba --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,10 @@ +# MongoDB Connector Changelog +This changelog documents the changes between release versions. + +## [Unreleased] +Changes to be included in the next upcoming release + +- Improved error messages when unsupported enum types or unions of literal types are found, and allow these types to be used in relaxed types mode ([#17](https://github.com/hasura/ndc-nodejs-lambda/pull/17)) + +## [0.1.0] - 2024-03-14 +TBD \ No newline at end of file diff --git a/scripts/generate-manifest.sh b/scripts/generate-manifest.sh new file mode 100755 index 00000000..4cd54d00 --- /dev/null +++ b/scripts/generate-manifest.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -evo pipefail +ROOT="$(pwd)" + +export LINUX_AMD64_SHA256=$(cat ${ROOT}/release/artifacts/sha256sum | grep hasura-mongodb-x86_64-unknown-linux-gnu | cut -f1 -d' ') +export MACOS_AMD64_SHA256=$(cat ${ROOT}/release/artifacts/sha256sum | grep hasura-mongodb-x86_64-apple-darwin | cut -f1 -d' ') +export WINDOWS_AMD64_SHA256=$(cat ${ROOT}/release/artifacts/sha256sum | grep hasura-mongodb-x86_64-pc-windows-msvc.exe | cut -f1 -d' ') +export LINUX_ARM64_SHA256=$(cat ${ROOT}/release/artifacts/sha256sum | grep hasura-mongodb-aarch64-unknown-linux-gnu | cut -f1 -d' ') +export MACOS_ARM64_SHA256=$(cat ${ROOT}/release/artifacts/sha256sum | grep hasura-mongodb-aarch64-apple-darwin | cut -f1 -d' ') + +(echo "cat <${ROOT}/release/manifest.yaml"; +cat ${ROOT}/scripts/manifest.yaml; echo; echo EOF; +)>${ROOT}/release/manifest-tmp.yaml +. ${ROOT}/release/manifest-tmp.yaml \ No newline at end of file diff --git a/scripts/manifest.yaml b/scripts/manifest.yaml new file mode 100644 index 00000000..025753f7 --- /dev/null +++ b/scripts/manifest.yaml @@ -0,0 +1,40 @@ +name: ndc-mongo +version: "${VERSION}" +shortDescription: "CLI plugin for Hasura ndc-mongo" +homepage: https://hasura.io/connectors/mongo +platforms: + - selector: darwin-arm64 + uri: "https://github.com/hasura/ndc-mongo/releases/download/${VERSION}/hasura-mongodb-aarch64-apple-darwin" + sha256: "${MACOS_ARM64_SHA256}" + bin: "hasura-ndc-mongo" + files: + - from: "./hasura-mongodb-aarch64-apple-darwin" + to: "hasura-ndc-mongo" + - selector: linux-arm64 + uri: "https://github.com/hasura/ndc-mongo/releases/download/${VERSION}/hasura-mongodb-aarch64-unknown-linux-gnu" + sha256: "${LINUX_ARM64_SHA256}" + bin: "hasura-ndc-mongo" + files: + - from: "./hasura-mongodb-aarch64-unknown-linux-gnu" + to: "hasura-ndc-mongo" + - selector: darwin-amd64 + uri: "https://github.com/hasura/ndc-mongo/releases/download/${VERSION}/hasura-mongodb-x86_64-apple-darwin" + sha256: "${MACOS_AMD64_SHA256}" + bin: "hasura-ndc-mongo" + files: + - from: "./hasura-mongodb-x86_64-apple-darwin" + to: "hasura-ndc-mongo" + - selector: windows-amd64 + uri: "https://github.com/hasura/ndc-mongo/releases/download/${VERSION}/hasura-mongodb-x86_64-pc-windows-msvc.exe" + sha256: "${WINDOWS_AMD64_SHA256}" + bin: "hasura-ndc-mongo.exe" + files: + - from: "./hasura-mongodb-x86_64-pc-windows-msvc.exe" + to: "hasura-ndc-mongo.exe" + - selector: linux-amd64 + uri: "https://github.com/hasura/ndc-mongo/releases/download/${VERSION}/hasura-mongodb-x86_64-unknown-linux-gnu" + sha256: "${LINUX_AMD64_SHA256}" + bin: "hasura-ndc-mongo" + files: + - from: "./hasura-mongodb-x86_64-unknown-linux-gnu" + to: "hasura-ndc-mongo" \ No newline at end of file