Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2024 Intel Corporation
# Copyright 2025 Canonical Ltd.
name: Release Pipeline

on:
push:
branches:
- master
paths:
- "VERSION"

permissions:
contents: read

jobs:
# Tag GitHub Release
# The convention is to prefix the version with a 'v', e.g., v1.2.3
tag-github:
uses: onosproject/.github/.github/workflows/tag-github.yml@main
with:
add_v: true
secrets: inherit

# Build and Release Docker Image
# The convention is to use the same tag for the Docker image as the GitHub Release
release-image:
needs: tag-github
if: needs.tag-github.outputs.changed == 'true'
permissions:
contents: read
packages: write
actions: read
id-token: write
attestations: write
uses: onosproject/.github/.github/workflows/release-image.yml@main
with:
docker_tag: ${{ needs.tag-github.outputs.version }}
secrets: inherit

# Bump Version
update-version:
needs: tag-github
if: needs.tag-github.outputs.changed == 'true'
uses: onosproject/.github/.github/workflows/bump-version.yml@main
secrets: inherit
20 changes: 16 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ export GO111MODULE=on
VERSION ?= $(shell cat ./VERSION)

KIND_CLUSTER_NAME ?= kind
DOCKER_REPOSITORY ?= onosproject/
ONOS_SDCORE_ADAPTER_VERSION ?= latest
DOCKER_TAG ?= ${ONOS_SDCORE_ADAPTER_VERSION}
DOCKER_REPOSITORY ?= onosproject/
DOCKER_REGISTRY ?= ""
DOCKER_IMAGENAME := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}sdcore-adapter:${DOCKER_TAG}
LOCAL_AETHER_MODELS ?=
PLATFORM ?= --platform linux/x86_64

## Docker labels. Only set ref and commit date if committed
DOCKER_LABEL_VCS_URL ?= $(shell git remote get-url $(shell git remote))
Expand All @@ -40,6 +44,14 @@ all: build images
build-tools:=$(shell if [ ! -d "./build/build-tools" ]; then cd build && git clone https://github.com/onosproject/build-tools.git; fi)
include ./build/build-tools/make/onf-common.mk

# Docker targets for compatibility with GitHub workflow
docker-build: # @HELP build Docker image
docker-build: images

docker-push: # @HELP push Docker image
docker-push:
docker push ${DOCKER_IMAGENAME}

images: # @HELP build simulators image
images: sdcore-adapter-docker

Expand Down Expand Up @@ -74,17 +86,17 @@ jenkins-test: build deps license linters images jenkins-tools
TEST_PACKAGES=`go list github.com/onosproject/sdcore-adapter/...` ./build/build-tools/build/jenkins/make-unit

sdcore-adapter-docker: local-aether-models
docker build . -f Dockerfile \
docker build ${PLATFORM} . -f Dockerfile \
$(DOCKER_BUILD_ARGS) \
-t ${DOCKER_REPOSITORY}sdcore-adapter:${ONOS_SDCORE_ADAPTER_VERSION}
-t ${DOCKER_IMAGENAME}

kind: # @HELP build Docker images and add them to the currently configured kind cluster
kind: images kind-only

kind-only: # @HELP deploy the image without rebuilding first
kind-only:
@if [ "`kind get clusters`" = '' ]; then echo "no kind cluster found" && exit 1; fi
kind load docker-image --name ${KIND_CLUSTER_NAME} ${DOCKER_REPOSITORY}sdcore-adapter:${ONOS_SDCORE_ADAPTER_VERSION}
kind load docker-image --name ${KIND_CLUSTER_NAME} ${DOCKER_IMAGENAME}

publish: # @HELP publish version on github and dockerhub
./build/build-tools/publish-version ${VERSION} onosproject/sdcore-adapter
Expand Down
Loading