-
Notifications
You must be signed in to change notification settings - Fork 326
111 lines (83 loc) · 2.86 KB
/
anonymization-backend-release.yml
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: anonymization-backend-release
on:
workflow_dispatch:
inputs:
title:
description: 'Title for the release'
required: true
type: string
description:
description: 'Human-readable description of the release'
required: true
type: string
permissions:
contents: write
env:
NAME: anonymization-backend
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
defaults:
run:
shell: bash
jobs:
build-and-release:
name: Build and release the anonymization backend canister
runs-on:
group: zh1
labels: dind-large
container:
image: ghcr.io/dfinity/ic-build@sha256:4fd13b47285e783c3a6f35aadd9559d097c0de162a1cf221ead66ab1598d5d45
options: >-
-e NODE_NAME --privileged --cgroupns host -v /cache:/cache -v /var/sysimage:/var/sysimage -v /var/tmp:/var/tmp -v /ceph-s3-info:/ceph-s3-info
steps:
- uses: actions/checkout@v4
- name: build
run: |
TARGET='//rs/boundary_node/anonymization/backend:anonymization_backend'
bazel build --config=ci ${TARGET}
OUTPUT='bazel-bin/rs/boundary_node/anonymization/backend/anonymization_backend.wasm.gz'
mv ${OUTPUT} anonymization_backend.wasm.gz
- name: artifacts
run: |
ARTIFACTS=(
anonymization_backend.wasm.gz
)
echo "ARTIFACTS<<EOF" >> $GITHUB_ENV
for ARTIFACT in ${ARTIFACTS[@]}; do echo ${ARTIFACT} >> $GITHUB_ENV; done
echo "EOF" >> $GITHUB_ENV
- name: checksums
run: |
CHECKSUMS=$(mktemp)
for ARTIFACT in ${ARTIFACTS}; do
shasum -a256 ${ARTIFACT} >> ${CHECKSUMS}
done
echo "CHECKSUMS=${CHECKSUMS}" >> "${GITHUB_ENV}"
- name: tag
run: |
COMMIT_SHORT=$(git rev-parse --short HEAD)
RELEASE_TAG="${{ env.NAME }}-${COMMIT_SHORT}"
echo "RELEASE_TAG=${RELEASE_TAG}" >> "${GITHUB_ENV}"
- name: release notes
run: |
NOTES=$(mktemp)
CODE_BLOCK='```'
cat > ${NOTES} <<EOF
${{ inputs.description }}
## Verification
To reproduce the artifacts of this release:
${CODE_BLOCK}
bazel build --config=local //rs/boundary_node/anonymization/backend:anonymization_backend
${CODE_BLOCK}
## Checksums
${CODE_BLOCK}
$(cat ${CHECKSUMS})
${CODE_BLOCK}
EOF
echo "NOTES=${NOTES}" >> "${GITHUB_ENV}"
- name: release
uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8
with:
tag_name: ${{ env.RELEASE_TAG }}
name: ${{ inputs.title }}
make_latest: false
body_path: ${{ env.NOTES }}
files: ${{ env.ARTIFACTS }}