Add a skeleton for the release pipeline

This commit is contained in:
Roman Gershman 2022-05-25 21:14:04 +03:00
parent 5ad6352ad7
commit 45029dae9a
3 changed files with 103 additions and 1 deletions

87
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,87 @@
name: Version Release
on:
push:
tags:
- 'v*'
jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Create Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
omitBody: true
prerelease: true
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
qemu_job:
runs-on: ubuntu-latest
permissions:
contents: write
name: Build aarch64 on ubuntu20.04
needs: create-release
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: uraimo/run-on-arch-action@v2
name: Run commands
id: runcmd
with:
arch: aarch64
distro: ubuntu20.04
githubToken: ${{ github.token }}
# Create an artifacts directory
setup: |
mkdir -p "${PWD}/artifacts"
# Mount the artifacts directory as /artifacts in the container
dockerRunArgs: |
--volume "${{ github.workspace }}:/src"
# The shell to run commands with in the container
shell: /bin/bash
install: |
export DEBIAN_FRONTEND=noninteractive
apt update && apt install -q -y autoconf-archive cmake curl git libssl-dev \
libunwind-dev ninja-build libtool gcc-9 g++-9 libboost-fiber-dev \
libxml2-dev zip
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 40 \
--slave /usr/bin/g++ g++ /usr/bin/g++-9
run: |
cd /src
./tools/release.sh
- name: Show the artifact
# Items placed in /src/build-opt in the container will be in
# ${PWD}/build-opt on the host.
run: |
echo finished
ls -al
build_native:
runs-on: ubuntu-latest
needs: create-release
container:
image: ghcr.io/romange/ubuntu-dev:20
permissions:
contents: write
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build artifacts
run: |
./tools/release.sh
- uses: ncipollo/release-action@v1
with:
artifacts: "build-opt/dragonfly-*"
allowUpdates: true
body: "example"
draft: true
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -10,7 +10,7 @@ COPY src/ ./src/
COPY helio/ ./helio/
COPY patches/ ./patches/
COPY CMakeLists.txt ./
RUN ./helio/blaze.sh -release -DBoost_USE_STATIC_LIBS=ON
RUN ./helio/blaze.sh -release -DBoost_USE_STATIC_LIBS=ON -DOPENSSL_USE_STATIC_LIBS=ON
WORKDIR build-opt
RUN ninja dragonfly

15
tools/release.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
set -e
if ! [ -d helio ]; then
echo "could not find helio"
exit 1
fi
ARCH=`uname -m`
pwd
./helio/blaze.sh -release -DBoost_USE_STATIC_LIBS=ON -DOPENSSL_USE_STATIC_LIBS=ON
cd build-opt
ninja dragonfly && ldd dragonfly
mv dragonfly dragonfly-${ARCH}