From 679ac7c803dc4d7988f047474c67ac8f12a6e58b Mon Sep 17 00:00:00 2001 From: Michael Sauter Date: Fri, 29 Sep 2023 13:59:12 +0200 Subject: [PATCH] Fix release workflow --- .github/workflows/release.yaml | 11 +++++------ Makefile | 5 +---- README.md | 2 ++ version | 1 + 4 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 version diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index dbe2ebe..9dfa14e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,10 +5,9 @@ on: - released env: - # Use docker.io for Docker Hub if empty REGISTRY: ghcr.io - # github.repository as / IMAGE_BASE: ${{ github.repository }} + IMAGE_NAME: node18-npm-toolset jobs: build: @@ -22,11 +21,11 @@ jobs: name: Create image tag run: | IMAGE_TAG=$(echo ${{ github.event.release.tag_name }} | sed 's/v//') - echo "{imageTag}={$IMAGE_TAG}" >> $GITHUB_OUTPUT + echo "imageTag=$IMAGE_TAG" >> $GITHUB_OUTPUT - id: createImageBase run: | - echo "{imageBase}={${IMAGE_BASE,,}}" >> $GITHUB_OUTPUT + echo "imageBase=${IMAGE_BASE,,}" >> $GITHUB_OUTPUT - name: Setup Docker buildx uses: docker/setup-buildx-action@v2 @@ -43,6 +42,6 @@ jobs: uses: docker/build-push-action@v4 with: context: . - file: build/images/Dockerfile.go-toolset + file: build/images/Dockerfile.${{env.IMAGE_NAME}} push: true - tags: ${{ env.REGISTRY }}/${{steps.createImageBase.outputs.imageBase}}/go-toolset:${{ outputs.imageTag }} + tags: ${{env.REGISTRY}}/${{steps.createImageBase.outputs.imageBase}}/${{env.IMAGE_NAME}}:${{steps.createImageTag.outputs.imageTag}} diff --git a/Makefile b/Makefile index c5b10f0..1c86664 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,6 @@ SHELL = /bin/bash MAKEFLAGS += --warn-undefined-variables MAKEFLAGS += --no-builtin-rules -# Variables -VERSION?=latest - ##@ General # help target is based on https://github.com/operator-framework/operator-sdk/blob/master/release/Makefile. @@ -32,7 +29,7 @@ image-node18-npm-toolset: ## Build node18-npm-toolset image. tasks: ## Render tasks. Use VERSION=1.0.0 make tasks to render specific version. go run github.com/opendevstack/ods-pipeline/cmd/taskmanifest \ -data ImageRepository=ghcr.io/opendevstack/ods-pipeline-npm \ - -data Version=$(VERSION) \ + -data Version=$$(cat version) \ -template build/tasks/build.yaml \ -destination tasks/build.yaml .PHONY: tasks diff --git a/README.md b/README.md index 023ea01..3e4d600 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # ods-pipeline-npm +[![Tests](https://github.com/opendevstack/ods-pipeline-npm/actions/workflows/main.yaml/badge.svg)](https://github.com/opendevstack/ods-pipeline-npm/actions/workflows/main.yaml) + Tekton task for use with [ODS Pipeline](https://github.com/opendevstack/ods-pipeline) to build Go applications. ## Usage diff --git a/version b/version new file mode 100644 index 0000000..a0f9a4b --- /dev/null +++ b/version @@ -0,0 +1 @@ +latest