dragonfly/.github/workflows/release.yml
2025-05-09 17:43:39 +03:00

139 lines
4.3 KiB
YAML

name: Version Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
env:
RELEASE_DIR: build-release
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-arm:
runs-on: ubuntu-24.04-arm
name: Build arm64 on ubuntu-24.04-arm
needs: create-release
container:
image: ghcr.io/romange/ubuntu-dev:20
options: --security-opt seccomp=unconfined --sysctl "net.ipv6.conf.all.disable_ipv6=0"
steps:
- uses: actions/checkout@v4
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
./tools/packaging/generate_debian_package.sh ${{ env.RELEASE_DIR }}/dragonfly-aarch64
mv dragonfly_*.deb ${{ env.RELEASE_DIR }}/
- name: Upload
uses: actions/upload-artifact@v4
with:
name: dragonfly-aarch64
path: |
${{ env.RELEASE_DIR }}/dragonfly-*tar.gz
${{ env.RELEASE_DIR }}/dragonfly_*.deb
${{ env.RELEASE_DIR }}/dfly_bench-*tar.gz
build-native:
runs-on: ubuntu-latest
needs: create-release
strategy:
matrix:
include:
# Build with these flags
- name: debian
container: ubuntu-dev:20
- name: rpm
container: fedora:30
container:
image: ghcr.io/romange/${{ matrix.container }}
options: --security-opt seccomp=unconfined --sysctl "net.ipv6.conf.all.disable_ipv6=0"
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Configure
run: |
if [ -f /etc/redhat-release ]; then
dnf install -y rpm-build libstdc++-static
fi
- name: Build artifacts
timeout-minutes: 25
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
# once the build is over, we want to generate a Debian package
if [ -f /etc/debian_version ]; then
./tools/packaging/generate_debian_package.sh ${{ env.RELEASE_DIR }}/dragonfly-x86_64
else
echo "Creating package for ${{github.ref_name}}"
./tools/packaging/rpm/build_rpm.sh ${{ env.RELEASE_DIR }}/dragonfly-x86_64.tar.gz ${{github.ref_name}}
fi
- name: Run regression tests
# Fedora 30 has older python packages, so this fails during requirements installation.
if : matrix.container != 'fedora:30'
uses: ./.github/actions/regression-tests
with:
dfly-executable: dragonfly-x86_64
gspace-secret: ${{ secrets.GSPACES_BOT_DF_BUILD }}
build-folder-name: ${{ env.RELEASE_DIR }}
- name: Save artifacts
run: |
# place all artifacts at the same location
mkdir -p results-artifacts
if [ -f /etc/debian_version ]; then
mv ${{ env.RELEASE_DIR }}/dragonfly-*tar.gz results-artifacts
mv dragonfly_*.deb results-artifacts
mv ${{ env.RELEASE_DIR }}/dfly_bench-*tar.gz results-artifacts
else
ls -l *.rpm
mv ./*.rpm ./results-artifacts/
fi
- name: Upload
uses: actions/upload-artifact@v4
with:
name: dragonfly-amd64-${{ matrix.name }}
path: results-artifacts/*
publish_release:
runs-on: ubuntu-latest
needs: [build-native, build-arm]
steps:
- uses: actions/download-artifact@v4
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 }}