Skip to content

Commit 55bd500

Browse files
committed
add tdx-quote-provider to release workflow
1 parent f793f54 commit 55bd500

File tree

3 files changed

+147
-3
lines changed

3 files changed

+147
-3
lines changed

.github/workflows/release.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release Optimism
33
on:
44
push:
55
tags:
6-
- "v*"
6+
- "op-rbuilder/v*"
77
workflow_dispatch:
88
inputs:
99
draft-release:
@@ -101,12 +101,14 @@ jobs:
101101
git config --global --add safe.directory "$(pwd)"
102102
. $HOME/.cargo/env
103103
cargo build --release --features=${{ matrix.features }} --target ${{ matrix.configs.target }} --package op-rbuilder
104+
mkdir -p artifacts
105+
mv target/${{ matrix.configs.target }}/release/op-rbuilder artifacts/op-rbuilder-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}${{ matrix.features && '-' }}${{ matrix.features }}
104106
105-
- name: Upload op-rbuilder artifact
107+
- name: Upload artifacts
106108
uses: actions/upload-artifact@v4
107109
with:
108110
name: op-rbuilder-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}${{ matrix.features && '-' }}${{ matrix.features }}
109-
path: target/${{ matrix.configs.target }}/release/op-rbuilder
111+
path: artifacts
110112

111113
draft-release:
112114
name: Draft release
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: Release TDX Quote Provider
2+
3+
on:
4+
pull_request:
5+
push:
6+
tags:
7+
- "tdx-quote-provider/v*"
8+
workflow_dispatch:
9+
inputs:
10+
draft-release:
11+
default: false
12+
description: "Draft Release"
13+
required: false
14+
type: boolean
15+
features:
16+
default: ""
17+
description: "Binary Compilation Features"
18+
options:
19+
- ""
20+
required: false
21+
type: choice
22+
23+
jobs:
24+
extract-version:
25+
name: Extract version
26+
runs-on: warp-ubuntu-latest-x64-16x
27+
outputs:
28+
VERSION: ${{ steps.extract_version.outputs.VERSION }}
29+
steps:
30+
- name: Extract version
31+
id: extract_version
32+
run: |
33+
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
34+
VERSION="${GITHUB_REF#refs/tags/}"
35+
else
36+
VERSION="$(echo ${GITHUB_SHA} | cut -c1-7)"
37+
fi
38+
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
39+
40+
echo "| | |" >> $GITHUB_STEP_SUMMARY
41+
echo "| ------------------- | ---------------------- |" >> $GITHUB_STEP_SUMMARY
42+
echo "| \`GITHUB_REF_TYPE\` | \`${GITHUB_REF_TYPE}\` |" >> $GITHUB_STEP_SUMMARY
43+
echo "| \`GITHUB_REF_NAME\` | \`${GITHUB_REF_NAME}\` |" >> $GITHUB_STEP_SUMMARY
44+
echo "| \`GITHUB_REF\` | \`${GITHUB_REF}\` |" >> $GITHUB_STEP_SUMMARY
45+
echo "| \`GITHUB_SHA\` | \`${GITHUB_SHA}\` |" >> $GITHUB_STEP_SUMMARY
46+
echo "| \`VERSION\` | \`${VERSION}\` |" >> $GITHUB_STEP_SUMMARY
47+
echo "| \`FEATURES\` | \`${{ github.event.inputs.features || 'none' }}\` |" >> $GITHUB_STEP_SUMMARY
48+
49+
build-binary:
50+
name: Build binary
51+
needs: extract-version
52+
runs-on: ${{ matrix.configs.runner }}
53+
container:
54+
image: ubuntu:22.04
55+
permissions:
56+
contents: write
57+
packages: write
58+
strategy:
59+
matrix:
60+
configs:
61+
- target: x86_64-unknown-linux-gnu
62+
runner: warp-ubuntu-latest-x64-32x
63+
- target: aarch64-unknown-linux-gnu
64+
runner: warp-ubuntu-latest-arm64-32x
65+
# Paused until docker is pre-installed https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
66+
# - target: aarch64-apple-darwin
67+
# runner: warp-macos-14-arm64-6x
68+
features:
69+
- ${{ github.event.inputs.features || '' }}
70+
71+
steps:
72+
- name: Install dependencies
73+
run: |
74+
apt-get update
75+
apt-get install -y \
76+
build-essential \
77+
curl \
78+
git \
79+
libclang-dev \
80+
libssl-dev \
81+
libtss2-dev \
82+
pkg-config \
83+
protobuf-compiler
84+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
85+
86+
- uses: actions/checkout@v4 # must install git before checkout and set safe.directory after checkout because of container
87+
88+
- name: Build tdx-quote-provider binary
89+
run: |
90+
git config --global --add safe.directory "$(pwd)"
91+
. $HOME/.cargo/env
92+
cargo build --release --features=${{ matrix.features }} --target ${{ matrix.configs.target }} --package tdx-quote-provider
93+
mkdir -p artifacts
94+
mv target/${{ matrix.configs.target }}/release/tdx-quote-provider artifacts/tdx-quote-provider-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}${{ matrix.features && '-' }}${{ matrix.features }}
95+
96+
- name: Upload artifacts
97+
uses: actions/upload-artifact@v4
98+
with:
99+
name: tdx-quote-provider-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}${{ matrix.features && '-' }}${{ matrix.features }}
100+
path: artifacts
101+
102+
draft-release:
103+
name: Draft release
104+
# if: ${{ github.event.inputs.draft-release == 'true' || github.event_name == 'push'}} # when manually triggered or version tagged
105+
needs: [extract-version, build-binary]
106+
runs-on: warp-ubuntu-latest-x64-16x
107+
env:
108+
VERSION: op-${{ needs.extract-version.outputs.VERSION }}
109+
permissions:
110+
contents: write
111+
steps:
112+
- name: Checkout
113+
uses: actions/checkout@v4
114+
115+
- name: Download artifacts
116+
uses: actions/download-artifact@v4
117+
with:
118+
merge-multiple: true
119+
path: artifacts
120+
121+
- name: Record artifacts checksums
122+
working-directory: artifacts
123+
run: |
124+
find ./ || true
125+
for file in *; do sha256sum "$file" >> sha256sums.txt; done;
126+
cat sha256sums.txt
127+
128+
- name: Create release draft
129+
uses: softprops/[email protected]
130+
id: create-release-draft
131+
with:
132+
draft: true
133+
files: artifacts/*
134+
generate_release_notes: true
135+
name: ${{ env.VERSION }}
136+
tag_name: ${{ env.VERSION }}
137+
138+
- name: Write Github Step Summary
139+
run: |
140+
echo "---"
141+
echo "### Release Draft: ${{ env.VERSION }}" >> $GITHUB_STEP_SUMMARY
142+
echo "${{ steps.create-release-draft.outputs.url }}" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)