Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit 19a5bcd

Browse files
Merge pull request #288 from boschglobal/feature/databroker_release_workflow
[databroker] Add release workflow
2 parents 73e52b4 + 3cfee05 commit 19a5bcd

File tree

2 files changed

+90
-2
lines changed

2 files changed

+90
-2
lines changed

.github/workflows/kuksa_databroker_build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ jobs:
201201
labels: |
202202
org.opencontainers.image.source=https://github.com/${{ github.repository }}
203203
204-
- name: Temporarily save container image
204+
- name: Save container image (multiarch)
205205
uses: actions/upload-artifact@v3
206206
with:
207-
name: Container image (multiarch)
207+
name: databroker-oci-multiarch.tar
208208
path: ${{github.workspace}}/databroker-oci-multiarch.tar
209209
retention-days: 1
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# /********************************************************************************
2+
# * Copyright (c) 2022 Contributors to the Eclipse Foundation
3+
# *
4+
# * See the NOTICE file(s) distributed with this work for additional
5+
# * information regarding copyright ownership.
6+
# *
7+
# * This program and the accompanying materials are made available under the
8+
# * terms of the Apache License 2.0 which is available at
9+
# * http://www.apache.org/licenses/LICENSE-2.0
10+
# *
11+
# * SPDX-License-Identifier: Apache-2.0
12+
# ********************************************************************************/
13+
14+
name: kuksa_databroker_release
15+
16+
on:
17+
# workflow_dispatch: #TODO: input versions manually
18+
push:
19+
tags:
20+
- "databroker-v*.*.*"
21+
22+
jobs:
23+
build_databroker:
24+
uses: ./.github/workflows/kuksa_databroker_build.yml
25+
create_release:
26+
runs-on: ubuntu-latest
27+
needs: [build_databroker]
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v3
31+
- name: Get the version
32+
id: get_version
33+
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/databroker-/}
34+
35+
- name: Download all artifacts
36+
uses: actions/download-artifact@v3
37+
with:
38+
path: bin/
39+
- name: Create release
40+
id: create_release
41+
uses: softprops/action-gh-release@v1
42+
with:
43+
draft: true
44+
fail_on_unmatched_files: true
45+
files: |
46+
bin/**
47+
LICENSE
48+
NOTICE.md
49+
50+
release-databroker-image:
51+
name: "Download and push to ghcr (databroker)"
52+
runs-on: ubuntu-latest
53+
54+
needs: [build_databroker]
55+
steps:
56+
- id: repository-name-adjusted
57+
name: Prepare repository name in lower case for docker upload. This supports repository names in mixed case
58+
uses: ASzc/change-string-case-action@v2
59+
with:
60+
string: ${{ github.repository }}
61+
62+
- name: Get the version
63+
id: get_version
64+
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/databroker-/}
65+
66+
- name: Retrieve saved Docker image
67+
uses: actions/download-artifact@v3
68+
with:
69+
name: databroker-oci-multiarch.tar
70+
path: ${{github.workspace}}
71+
72+
- name: Login to GitHub Container Registry
73+
uses: docker/login-action@v1
74+
with:
75+
registry: ghcr.io
76+
username: ${{ github.repository_owner }}
77+
password: ${{ secrets.GITHUB_TOKEN }}
78+
79+
- name: "Push image to ghcr"
80+
env:
81+
VAL_NAME: databroker
82+
VAL_VERSION: ${{ steps.get_version.outputs.version }}
83+
GIT_HUB_REPOSITORY_NAME_LOWER_CASE: ${{ steps.repository-name-adjusted.outputs.lowercase }}
84+
shell: bash
85+
run: |
86+
skopeo copy --all oci-archive:databroker-oci-multiarch.tar "docker://ghcr.io/$GIT_HUB_REPOSITORY_NAME_LOWER_CASE/$VAL_NAME:$VAL_VERSION"
87+
skopeo inspect --raw "docker://ghcr.io/$GIT_HUB_REPOSITORY_NAME_LOWER_CASE/$VAL_NAME:$VAL_VERSION" | jq
88+
skopeo inspect "docker://ghcr.io/$GIT_HUB_REPOSITORY_NAME_LOWER_CASE/$VAL_NAME:$VAL_VERSION"

0 commit comments

Comments
 (0)