Draft Release #104
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
# Copyright 2024 The Drasi Authors. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
name: Draft Release | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Version Tag' | |
required: true | |
image_prefix: | |
description: 'Image Prefix' | |
required: false | |
default: 'ghcr.io/drasi-project' | |
permissions: | |
id-token: write | |
contents: read | |
packages: write | |
# Environment variables with consistent `platforms` fields | |
env: | |
RELEASE_PATH: ./release | |
QUERY_COMPONENTS: '[ | |
{"label": "Query Host", "path": "query-container/query-host", "name": "query-container-query-host", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "Publish API", "path": "query-container/publish-api", "name": "query-container-publish-api", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "View Service", "path": "query-container/view-svc", "name": "query-container-view-svc", "platforms": "linux/amd64,linux/arm64"}]' | |
CONTROL_PLANE_COMPONENTS: '[ | |
{"label": "Management API", "path": "control-planes/mgmt_api", "name": "api", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "k8s Resource Provider", "path": "control-planes/kubernetes_provider", "name": "kubernetes-provider", "platforms": "linux/amd64,linux/arm64"}]' | |
SOURCES_COMPONENTS: '[ | |
{"label": "Change Router", "path": "sources/shared/change-router", "name": "source-change-router", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "Change Dispatcher", "path": "sources/shared/change-dispatcher", "name": "source-change-dispatcher", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "Query API", "path": "sources/shared/query-api", "name": "source-query-api", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "Debezium Reactivator", "path": "sources/relational/debezium-reactivator", "name": "source-debezium-reactivator", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "SQL Proxy", "path": "sources/relational/sql-proxy", "name": "source-sql-proxy", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "CosmosDB Reactivator", "path": "sources/cosmosdb/cosmosdb-ffcf-reactivator", "name": "source-cosmosdb-reactivator", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "Gremlin Proxy", "path": "sources/cosmosdb/gremlin-proxy", "name": "source-gremlin-proxy", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "Dataverse Reactivator", "path": "sources/dataverse/dataverse-reactivator", "name": "source-dataverse-reactivator", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "Dataverse Proxy", "path": "sources/dataverse/dataverse-proxy", "name": "source-dataverse-proxy", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "EventHub Reactivator", "path": "sources/eventhub/eventhub-reactivator", "name": "source-eventhub-reactivator", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "EventHub Proxy", "path": "sources/eventhub/eventhub-proxy", "name": "source-eventhub-proxy", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "Kubernetes Reactivator", "path": "sources/kubernetes/kubernetes-reactivator", "name": "source-kubernetes-reactivator", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "Kubernetes Proxy", "path": "sources/kubernetes/kubernetes-proxy", "name": "source-kubernetes-proxy", "platforms": "linux/amd64,linux/arm64"}]' | |
REACTIONS_COMPONENTS: '[ | |
{"label": "SignalR", "path": "reactions/signalr/signalr-reaction", "name": "reaction-signalr", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "Dataverse", "path": "reactions/power-platform/dataverse/dataverse-reaction", "name": "reaction-dataverse", "platforms": "linux/amd64"}, | |
{"label": "Debezium", "path": "reactions/debezium/debezium-reaction", "name": "reaction-debezium", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "Debug", "path": "reactions/platform/debug-reaction", "name": "reaction-debug", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "EventGrid", "path": "reactions/azure/eventgrid-reaction", "name": "reaction-eventgrid", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "EventBridge", "path": "reactions/aws/eventbridge-reaction", "name": "reaction-eventbridge", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "Gremlin", "path": "reactions/gremlin/gremlin-reaction", "name": "reaction-gremlin", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "Result", "path": "reactions/platform/result-reaction", "name": "reaction-result", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "StorageQueue", "path": "reactions/azure/storagequeue-reaction", "name": "reaction-storagequeue", "platforms": "linux/amd64,linux/arm64"}, | |
{"label": "StoredProc", "path": "reactions/sql/storedproc-reaction", "name": "reaction-storedproc", "platforms": "linux/amd64,linux/arm64"}]' | |
jobs: | |
# Setup job to parse and output component JSON | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
query_components: ${{ steps.set_components.outputs.query_components }} | |
control_plane_components: ${{ steps.set_components.outputs.control_plane_components }} | |
sources_components: ${{ steps.set_components.outputs.sources_components }} | |
reactions_components: ${{ steps.set_components.outputs.reactions_components }} | |
steps: | |
- name: Set Component Outputs | |
id: set_components | |
run: | | |
echo "query_components=$(echo '${{ env.QUERY_COMPONENTS }}' | jq -c .)" >> $GITHUB_OUTPUT | |
echo "control_plane_components=$(echo '${{ env.CONTROL_PLANE_COMPONENTS }}' | jq -c .)" >> $GITHUB_OUTPUT | |
echo "sources_components=$(echo '${{ env.SOURCES_COMPONENTS }}' | jq -c .)" >> $GITHUB_OUTPUT | |
echo "reactions_components=$(echo '${{ env.REACTIONS_COMPONENTS }}' | jq -c .)" >> $GITHUB_OUTPUT | |
- name: Debug Outputs | |
run: | | |
echo "Query Components: ${{ steps.set_components.outputs.query_components }}" | |
echo "Control Plane Components: ${{ steps.set_components.outputs.control_plane_components }}" | |
echo "Sources Components: ${{ steps.set_components.outputs.sources_components }}" | |
echo "Reactions Components: ${{ steps.set_components.outputs.reactions_components }}" | |
# Validate the branch name | |
validate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Validate Branch | |
run: | | |
if [[ "${{ github.ref_name }}" =~ ^(release)/ ]]; then | |
echo "Branch has the correct prefix." | |
else | |
echo "Branch does not have the correct prefix. Exiting..." | |
exit 1 | |
fi | |
# Build job for Query components | |
build-query-container: | |
needs: [validate, setup] | |
permissions: | |
packages: write | |
contents: read | |
runs-on: ${{ matrix.runner }} | |
strategy: | |
matrix: | |
runner: [ubuntu-latest, ubuntu-24.04-arm] | |
component: ${{ fromJson(needs.setup.outputs.query_components) }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
submodules: true | |
token: ${{ secrets.DRASI_CORE_PAT }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 | |
with: | |
install: true | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Determine platform and tag suffix | |
id: platform | |
run: | | |
if [[ "${{ matrix.runner }}" == "ubuntu-latest" ]]; then | |
echo "platform=linux/amd64" >> $GITHUB_OUTPUT | |
echo "suffix=-amd64" >> $GITHUB_OUTPUT | |
elif [[ "${{ matrix.runner }}" == "ubuntu-24.04-arm" ]]; then | |
echo "platform=linux/arm64" >> $GITHUB_OUTPUT | |
echo "suffix=-arm64" >> $GITHUB_OUTPUT | |
fi | |
- name: Build and Push to GHCR | |
if: contains(matrix.component.platforms, steps.platform.outputs.platform) | |
run: | | |
cd ${{ matrix.component.path }} | |
DOCKER_TAG_VERSION=${{ inputs.tag }}${{ steps.platform.outputs.suffix }} \ | |
IMAGE_PREFIX=${{ inputs.image_prefix }} \ | |
DOCKERX_OPTS="--push --platform ${{ steps.platform.outputs.platform }}" \ | |
make | |
# Manifest creation for Query Container components | |
create-query-container-manifest: | |
needs: build-query-container | |
runs-on: ubuntu-latest | |
steps: | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create and push manifest list | |
run: | | |
for component in $(echo '${{ env.QUERY_COMPONENTS }}' | jq -r '.[].name'); do | |
# Initialize an array to hold the manifests | |
manifests=() | |
# Get the expected platforms for the component as stored in JSON | |
expected_platforms=$(echo '${{ env.QUERY_COMPONENTS }}' | jq -r ".[] | select(.name == \"$component\") | .platforms") | |
# Does this component need to be built for linux/amd64? | |
if echo "$expected_platforms" | grep -q "linux/amd64"; then | |
# Check if the amd64 manifest exists and add it to the array | |
if docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-amd64 > /dev/null 2>&1; then | |
echo "Manifest for $component:${{ inputs.tag }}-amd64:" | |
docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-amd64 | |
manifests+=("ghcr.io/drasi-project/$component:${{ inputs.tag }}-amd64") | |
# If the amd64 manifest is not found, print an error message | |
else | |
echo "Error: Expected amd64 manifest not found for $component:${{ inputs.tag }}-amd64" >&2 | |
exit 1 | |
fi | |
fi | |
# Does this component need to be built for linux/arm64? | |
if echo "$expected_platforms" | grep -q "linux/arm64"; then | |
# Check and handle arm64 manifest with debug output | |
if docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-arm64 > /dev/null 2>&1; then | |
echo "Manifest for $component:${{ inputs.tag }}-arm64:" | |
docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-arm64 | |
manifests+=("ghcr.io/drasi-project/$component:${{ inputs.tag }}-arm64") | |
# If the arm64 manifest is not found, print an error message | |
else | |
echo "Error: Expected arm64 manifest found for $component:${{ inputs.tag }}-arm64" >&2 | |
exit 1 | |
fi | |
fi | |
# Create the manifest list if there are manifests to combine | |
if [ ${#manifests[@]} -gt 0 ]; then | |
docker buildx imagetools create -t ghcr.io/drasi-project/$component:${{ inputs.tag }} ${manifests[@]} | |
else | |
echo "No manifests found for $component, skipping manifest creation." | |
fi | |
done | |
# Build job for Control Plane components | |
build-control-plane: | |
needs: [validate, setup] | |
permissions: | |
packages: write | |
contents: read | |
runs-on: ${{ matrix.runner }} | |
strategy: | |
matrix: | |
runner: [ubuntu-latest, ubuntu-24.04-arm] | |
component: ${{ fromJson(needs.setup.outputs.control_plane_components) }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 | |
with: | |
install: true | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Determine platform and tag suffix | |
id: platform | |
run: | | |
if [[ "${{ matrix.runner }}" == "ubuntu-latest" ]]; then | |
echo "platform=linux/amd64" >> $GITHUB_OUTPUT | |
echo "suffix=-amd64" >> $GITHUB_OUTPUT | |
elif [[ "${{ matrix.runner }}" == "ubuntu-24.04-arm" ]]; then | |
echo "platform=linux/arm64" >> $GITHUB_OUTPUT | |
echo "suffix=-arm64" >> $GITHUB_OUTPUT | |
fi | |
- name: Build and Push to GHCR | |
if: contains(matrix.component.platforms, steps.platform.outputs.platform) | |
run: | | |
cd ${{ matrix.component.path }} | |
DOCKER_TAG_VERSION=${{ inputs.tag }}${{ steps.platform.outputs.suffix }} \ | |
IMAGE_PREFIX=${{ inputs.image_prefix }} \ | |
DOCKERX_OPTS="--push --platform ${{ steps.platform.outputs.platform }}" \ | |
make | |
# Manifest creation for Control Plane components | |
create-control-plane-manifest: | |
needs: build-control-plane | |
runs-on: ubuntu-latest | |
steps: | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create and push manifest list | |
run: | | |
for component in $(echo '${{ env.CONTROL_PLANE_COMPONENTS }}' | jq -r '.[].name'); do | |
manifests=() | |
# Check and handle amd64 manifest with debug output | |
if docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-amd64 > /dev/null 2>&1; then | |
echo "Manifest for $component:${{ inputs.tag }}-amd64:" | |
docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-amd64 | |
manifests+=("ghcr.io/drasi-project/$component:${{ inputs.tag }}-amd64") | |
else | |
echo "No amd64 manifest found for $component:${{ inputs.tag }}-amd64" | |
fi | |
# Check and handle arm64 manifest with debug output | |
if docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-arm64 > /dev/null 2>&1; then | |
echo "Manifest for $component:${{ inputs.tag }}-arm64:" | |
docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-arm64 | |
manifests+=("ghcr.io/drasi-project/$component:${{ inputs.tag }}-arm64") | |
else | |
echo "No arm64 manifest found for $component:${{ inputs.tag }}-arm64" | |
fi | |
# Create the manifest list if there are manifests to combine | |
if [ ${#manifests[@]} -gt 0 ]; then | |
docker buildx imagetools create -t ghcr.io/drasi-project/$component:${{ inputs.tag }} ${manifests[@]} | |
else | |
echo "No manifests found for $component, skipping manifest creation." | |
fi | |
done | |
# Build job for Sources components | |
build-sources: | |
needs: [validate, setup] | |
permissions: | |
packages: write | |
contents: read | |
runs-on: ${{ matrix.runner }} | |
strategy: | |
matrix: | |
runner: [ubuntu-latest, ubuntu-24.04-arm] | |
component: ${{ fromJson(needs.setup.outputs.sources_components) }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 | |
with: | |
install: true | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Determine platform and tag suffix | |
id: platform | |
run: | | |
if [[ "${{ matrix.runner }}" == "ubuntu-latest" ]]; then | |
echo "platform=linux/amd64" >> $GITHUB_OUTPUT | |
echo "suffix=-amd64" >> $GITHUB_OUTPUT | |
elif [[ "${{ matrix.runner }}" == "ubuntu-24.04-arm" ]]; then | |
echo "platform=linux/arm64" >> $GITHUB_OUTPUT | |
echo "suffix=-arm64" >> $GITHUB_OUTPUT | |
fi | |
- name: Build and Push to GHCR | |
if: contains(matrix.component.platforms, steps.platform.outputs.platform) | |
run: | | |
cd ${{ matrix.component.path }} | |
DOCKER_TAG_VERSION=${{ inputs.tag }}${{ steps.platform.outputs.suffix }} \ | |
IMAGE_PREFIX=${{ inputs.image_prefix }} \ | |
DOCKERX_OPTS="--push --platform ${{ steps.platform.outputs.platform }}" \ | |
make | |
# Manifest creation for Sources components | |
create-sources-manifest: | |
needs: build-sources | |
runs-on: ubuntu-latest | |
steps: | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create and push manifest list | |
run: | | |
for component in $(echo '${{ env.SOURCES_COMPONENTS }}' | jq -r '.[].name'); do | |
manifests=() | |
# Check and handle amd64 manifest with debug output | |
if docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-amd64 > /dev/null 2>&1; then | |
echo "Manifest for $component:${{ inputs.tag }}-amd64:" | |
docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-amd64 | |
manifests+=("ghcr.io/drasi-project/$component:${{ inputs.tag }}-amd64") | |
else | |
echo "No amd64 manifest found for $component:${{ inputs.tag }}-amd64" | |
fi | |
# Check and handle arm64 manifest with debug output | |
if docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-arm64 > /dev/null 2>&1; then | |
echo "Manifest for $component:${{ inputs.tag }}-arm64:" | |
docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-arm64 | |
manifests+=("ghcr.io/drasi-project/$component:${{ inputs.tag }}-arm64") | |
else | |
echo "No arm64 manifest found for $component:${{ inputs.tag }}-arm64" | |
fi | |
# Create the manifest list if there are manifests to combine | |
if [ ${#manifests[@]} -gt 0 ]; then | |
docker buildx imagetools create -t ghcr.io/drasi-project/$component:${{ inputs.tag }} ${manifests[@]} | |
else | |
echo "No manifests found for $component, skipping manifest creation." | |
fi | |
done | |
# Build job for Reactions components | |
build-reactions: | |
needs: [validate, setup] | |
permissions: | |
packages: write | |
contents: read | |
runs-on: ${{ matrix.runner }} | |
strategy: | |
matrix: | |
runner: [ubuntu-latest, ubuntu-24.04-arm] | |
component: ${{ fromJson(needs.setup.outputs.reactions_components) }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 | |
with: | |
install: true | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Determine platform and tag suffix | |
id: platform | |
run: | | |
if [[ "${{ matrix.runner }}" == "ubuntu-latest" ]]; then | |
echo "platform=linux/amd64" >> $GITHUB_OUTPUT | |
echo "suffix=-amd64" >> $GITHUB_OUTPUT | |
elif [[ "${{ matrix.runner }}" == "ubuntu-24.04-arm" ]]; then | |
echo "platform=linux/arm64" >> $GITHUB_OUTPUT | |
echo "suffix=-arm64" >> $GITHUB_OUTPUT | |
fi | |
- name: Build and Push to GHCR | |
if: contains(matrix.component.platforms, steps.platform.outputs.platform) | |
run: | | |
cd ${{ matrix.component.path }} | |
DOCKER_TAG_VERSION=${{ inputs.tag }}${{ steps.platform.outputs.suffix }} \ | |
IMAGE_PREFIX=${{ inputs.image_prefix }} \ | |
DOCKERX_OPTS="--push --platform ${{ steps.platform.outputs.platform }}" \ | |
make | |
# Manifest creation for Reactions components | |
create-reactions-manifest: | |
needs: build-reactions | |
runs-on: ubuntu-latest | |
steps: | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create and push manifest list | |
run: | | |
for component in $(echo '${{ env.REACTIONS_COMPONENTS }}' | jq -r '.[].name'); do | |
manifests=() | |
# Check and handle amd64 manifest with debug output | |
if docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-amd64 > /dev/null 2>&1; then | |
echo "Manifest for $component:${{ inputs.tag }}-amd64:" | |
docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-amd64 | |
manifests+=("ghcr.io/drasi-project/$component:${{ inputs.tag }}-amd64") | |
else | |
echo "No amd64 manifest found for $component:${{ inputs.tag }}-amd64" | |
fi | |
# Check and handle arm64 manifest with debug output | |
if docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-arm64 > /dev/null 2>&1; then | |
echo "Manifest for $component:${{ inputs.tag }}-arm64:" | |
docker manifest inspect ghcr.io/drasi-project/$component:${{ inputs.tag }}-arm64 | |
manifests+=("ghcr.io/drasi-project/$component:${{ inputs.tag }}-arm64") | |
else | |
echo "No arm64 manifest found for $component:${{ inputs.tag }}-arm64" | |
fi | |
# Create the manifest list if there are manifests to combine | |
if [ ${#manifests[@]} -gt 0 ]; then | |
docker buildx imagetools create -t ghcr.io/drasi-project/$component:${{ inputs.tag }} ${manifests[@]} | |
else | |
echo "No manifests found for $component, skipping manifest creation." | |
fi | |
done | |
build-cli: | |
runs-on: ubuntu-latest | |
needs: validate | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Set up Go | |
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | |
with: | |
go-version: '1.21' | |
- name: Cache Go modules | |
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1 | |
with: | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Build | |
working-directory: cli | |
run: make VERSION='${{ inputs.tag }}' | |
- name: Upload artifact | |
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 | |
with: | |
name: cli | |
path: cli/bin | |
package-cli: | |
needs: build-cli | |
runs-on: ubuntu-latest | |
name: Publish ${{ matrix.os }}_${{ matrix.arch }} binaries | |
environment: | |
name: github-actions | |
strategy: | |
matrix: | |
include: | |
- os: linux | |
arch: arm64 | |
- os: linux | |
arch: x64 | |
- os: darwin | |
arch: arm64 | |
- os: darwin | |
arch: x64 | |
- os: windows | |
arch: x64 | |
steps: | |
- name: Download binaries | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
name: cli | |
- name: Copy cli binaries to release (non-windows) | |
if: matrix.os != 'windows' | |
run: | | |
mkdir -p ${{ env.RELEASE_PATH}}/cli/${{ matrix.os }}-${{ matrix.arch }}/ | |
cp -r ${{ matrix.os }}-${{ matrix.arch }}/drasi ${{ env.RELEASE_PATH}}/drasi-${{ matrix.os }}-${{ matrix.arch }} | |
- name: Copy cli binaries to release (windows) | |
if: matrix.os == 'windows' | |
run: | | |
mkdir -p ${{ env.RELEASE_PATH}}/cli/${{ matrix.os }}-${{ matrix.arch }}/ | |
cp -r ${{ matrix.os }}-${{ matrix.arch }}/drasi.exe ${{ env.RELEASE_PATH}}/drasi-${{ matrix.os }}-${{ matrix.arch }}.exe | |
- name: Upload release | |
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 | |
with: | |
name: drasi_${{ matrix.os }}_${{ matrix.arch }} | |
path: ${{ env.RELEASE_PATH}} | |
vscode-extension: | |
name: Build and publish the VSCode extension | |
runs-on: ubuntu-latest | |
needs: validate | |
environment: | |
name: github-actions | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Building the extension | |
run: | | |
cd dev-tools/vscode/drasi | |
npm install -g @vscode/vsce | |
npm install | |
npm version ${{ inputs.tag }} | |
vsce package | |
- name: Copy the extension to release | |
run: | | |
mkdir -p ${{ env.RELEASE_PATH}}/vscode-extension/ | |
cp dev-tools/vscode/drasi/drasi-*.vsix ${{ env.RELEASE_PATH}} | |
- name: Upload release | |
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 | |
with: | |
name: drasi_vscode_extension | |
path: ${{ env.RELEASE_PATH}}/drasi-*.vsix | |
# Final release job | |
release: | |
permissions: | |
contents: write | |
packages: read | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
name: Draft Release | |
needs: | |
- validate | |
- create-query-container-manifest | |
- create-control-plane-manifest | |
- create-sources-manifest | |
- create-reactions-manifest | |
- package-cli | |
- vscode-extension | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Download CLI release | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
pattern: drasi_* | |
merge-multiple: true | |
path: ${{ env.RELEASE_PATH }} | |
- name: Download vscode release | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
name: drasi_vscode_extension | |
path: ${{ env.RELEASE_PATH }} | |
- name: Draft Release | |
run: | | |
gh release create ${{ inputs.tag }} ${{ env.RELEASE_PATH }}/* --draft --title ${{ inputs.tag }} --target ${{ github.ref_name }} --generate-notes |