-
Notifications
You must be signed in to change notification settings - Fork 7
78 lines (78 loc) · 2.71 KB
/
mp-spdz.publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#
# 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 MP-SPDZ
on:
push:
tags:
- "mp-spdz-v[0-9]+.[0-9]+.[0-9]+"
defaults:
run:
working-directory: klyshko-mp-spdz
env:
REGISTRY: ghcr.io
IMAGE_NAME: carbynestack/klyshko-mp-spdz
WORKING_DIRECTORY: klyshko-mp-spdz
jobs:
publish:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Retrieve license obligation resources
id: license-obligations
run: |
cd 3RD-PARTY-LICENSES
FILES=$(find . -maxdepth 1 -type d -not -path .)
if [ -n "$FILES" ]
then
echo "${FILES}" | zip -r@ 3rd-party-copyrights
fi
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
ARCHIVES=$(find . -regex "^./3rd-party-.*.zip$")
OBLIGATIONS_FOUND="false"
if [ -n "$ARCHIVES" ]
then
mv $(echo "${ARCHIVES}") ../license-obligations/
OBLIGATIONS_FOUND="true"
fi
echo "OBLIGATIONS_FOUND=${OBLIGATIONS_FOUND}" >> $GITHUB_OUTPUT
- name: Update Release with license obligations resources
uses: ncipollo/release-action@v1
if: steps.license-obligations.outputs.OBLIGATIONS_FOUND == 'true'
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=mp-spdz-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.fake-offline
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}