chore: release operator 0.3.1 (#95) #2
Workflow file for this run
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 (c) 2023 - for information on the respective copyright owner | |
# see the NOTICE file and/or the repository https://github.com/carbynestack/klyshko. | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
# | |
name: Publish Operator | |
on: | |
push: | |
tags: | |
- "operator-v[0-9]+.[0-9]+.[0-9]+" | |
defaults: | |
run: | |
working-directory: klyshko-operator | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: carbynestack/klyshko-operator | |
WORKING_DIRECTORY: klyshko-operator | |
jobs: | |
publish: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Retrieve license obligation resources | |
run: | | |
cd 3RD-PARTY-LICENSES | |
find . -maxdepth 1 -type d -not -path . | zip -r@ 3rd-party-copyrights | |
find . -iname origin.src | \ | |
awk '{ \ | |
split($0,b,"/"); \ | |
system("xargs < " $0 " curl --create-dirs -Lo ./sources/" b[2] ".zip " $2)}' && \ | |
find -regex './sources$' | awk '{system("zip -jr ./3rd-party-sources.zip " $0)}' | |
mkdir -p ../license-obligations && mv `find . -regex "^./3rd-party-.*.zip$"` ../license-obligations/ | |
- name: Update Release with license obligations resources | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
artifacts: ${{ env.WORKING_DIRECTORY }}/license-obligations/* | |
artifactErrorsFailBuild: true | |
makeLatest: true | |
omitBodyDuringUpdate: true | |
omitNameDuringUpdate: true | |
- name: Log in to container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=match,pattern=operator-v(\d+.\d+.\d+),group=1 | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
context: ${{ env.WORKING_DIRECTORY }} | |
file: ${{ env.WORKING_DIRECTORY }}/Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |