132 lines
3.8 KiB
YAML
132 lines
3.8 KiB
YAML
name: Version Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
create-release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Create Release
|
|
uses: ncipollo/release-action@v1
|
|
with:
|
|
allowUpdates: true
|
|
omitBody: true
|
|
prerelease: true
|
|
draft: true
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
build-qemu:
|
|
runs-on: ubuntu-latest
|
|
name: Build aarch64 on ubuntu20.04
|
|
needs: create-release
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
- name: Cache build deps
|
|
id: cache-deps
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
${{github.workspace}}/build-opt/
|
|
!${{github.workspace}}/build-opt/CMakeCache.txt
|
|
key: ${{ runner.os }}-release-deps-${{ github.sha }}
|
|
#restore-keys: |
|
|
# ${{ runner.os }}-release-deps-
|
|
|
|
- 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: |
|
|
# Work around https://github.com/actions/checkout/issues/766
|
|
git config --global --add safe.directory /src
|
|
cd /src
|
|
git describe --always --tags ${{ github.sha }}
|
|
|
|
if [ -d build-opt ]; then
|
|
chown -R root build-opt
|
|
ls -l ./build-opt
|
|
for i in `ls -d ./build-opt/_deps/*-src`; do
|
|
git config --global --add safe.directory $(realpath $i)
|
|
done
|
|
fi
|
|
./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
|
|
- name: Upload
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: dragonfly-aarch64
|
|
path: build-opt/dragonfly-*tar.gz
|
|
|
|
build-native:
|
|
runs-on: ubuntu-latest
|
|
needs: create-release
|
|
container:
|
|
image: ghcr.io/romange/ubuntu-dev:20
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
- name: Build artifacts
|
|
run: |
|
|
# Work around https://github.com/actions/checkout/issues/766
|
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
git describe --always --tags ${{ github.sha }}
|
|
./tools/release.sh
|
|
- name: Upload
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: dragonfly-amd64
|
|
path: build-opt/dragonfly-*tar.gz
|
|
|
|
publish_release:
|
|
runs-on: ubuntu-latest
|
|
needs: [build-native, build-qemu]
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
name: Download files
|
|
with:
|
|
path: artifacts
|
|
- name: See all the artifacts
|
|
run: |
|
|
ls -lR artifacts/
|
|
- uses: ncipollo/release-action@v1
|
|
with:
|
|
artifacts: "artifacts/dragonfly-*/*"
|
|
allowUpdates: true
|
|
draft: true
|
|
prerelease: true
|
|
omitNameDuringUpdate: true
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|