Test #20
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
name: Release | |
on: | |
push: | |
branches: | |
- main | |
- gha_release | |
tags: | |
- "ccf-0.*" | |
workflow_dispatch: | |
permissions: | |
contents: read | |
actions: read | |
checks: write | |
jobs: | |
release_notes: | |
name: Release Notes | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: "Check Release Notes" | |
run: | | |
set -ex | |
python scripts/extract-release-notes.py --target-git-version | |
shell: bash | |
- name: "Produce Release Notes" | |
run: | | |
set -ex | |
set -o pipefail | |
python ./scripts/extract-release-notes.py --target-git-version --append-mcr-images --describe-path-changes "./samples/constitution" | tee rel-notes.md | |
- name: "Upload .deb Package" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: relnotes | |
path: rel-notes.md | |
build_release: | |
needs: release_notes | |
name: Build Release | |
strategy: | |
matrix: | |
platform: | |
- name: virtual | |
image: default | |
nodes: [self-hosted, 1ES.Pool=gha-virtual-ccf-sub] | |
options: --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro | |
- name: snp | |
image: default | |
nodes: [self-hosted, 1ES.Pool=gha-virtual-ccf-sub] | |
options: --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /lib/modules:/lib/modules:ro | |
- name: sgx | |
image: sgx | |
nodes: [self-hosted, 1ES.Pool=gha-sgx-ccf-sub] | |
options: --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --device /dev/sgx_enclave:/dev/sgx_enclave --device /dev/sgx_provision:/dev/sgx_provision -v /dev/sgx:/dev/sgx -v /lib/modules:/lib/modules:ro | |
runs-on: ${{ matrix.platform.nodes }} | |
container: | |
image: ghcr.io/microsoft/ccf/ci/${{ matrix.platform.image }}:build-26-06-2024 | |
options: ${{ matrix.platform.options }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: "Build Release ${{ matrix.platform.name }}" | |
run: | | |
set -ex | |
git config --global --add safe.directory /__w/CCF/CCF | |
mkdir build | |
cd build | |
cmake -GNinja -DCOMPILE_TARGET=${{ matrix.platform.name }} -DCLIENT_PROTOCOLS_TEST=ON .. | |
ninja | |
shell: bash | |
- name: "Make .deb Package" | |
id: make_deb | |
run: | | |
set -ex | |
set -o pipefail | |
cd build | |
cmake -L .. 2>/dev/null | grep CMAKE_INSTALL_PREFIX: | cut -d = -f 2 > /tmp/install_prefix | |
cpack -V -G DEB | |
INITIAL_PKG=`ls *.deb` | |
CCF_GITHUB_PKG=${INITIAL_PKG//\~/_} | |
if [[ "$INITIAL_PKG" != "$CCF_GITHUB_PKG" ]]; then | |
mv $INITIAL_PKG $CCF_GITHUB_PKG | |
fi | |
echo "name=$CCF_GITHUB_PKG" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: "Upload .deb Package" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pkg-${{ matrix.platform.name }} | |
path: build/${{ steps.make_deb.outputs.name }} | |
create_release: | |
needs: build_release | |
name: Create Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Packages | |
uses: actions/download-artifact@v4 | |
with: | |
path: pkg | |
pattern: pkg-* | |
merge-multiple: true | |
- name: Download Release notes | |
uses: actions/download-artifact@v4 | |
with: | |
name: relnotes | |
- run: | | |
ls | |
ls -R pkg | |
- run: | | |
gh release create --title "CCF ${{ github.ref }}" --draft --notes-file rel-notes.md pkg/* | |
shell: bash |