Skip to content

chore: release action improvements #368

chore: release action improvements

chore: release action improvements #368

Workflow file for this run

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.21.0
with:
allowUpdates: true
omitBody: true
skipIfReleaseExists: true
prerelease: true
draft: true
generateReleaseNotes: true
updateOnlyUnreleased: true
commit: ${{ github.sha }}
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-gcc14
options: --security-opt seccomp=unconfined --sysctl "net.ipv6.conf.all.disable_ipv6=0"
steps:
- uses: actions/checkout@v6
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@v7
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-gcc14
- name: rpm
container: fedora:30-gcc14
container:
image: ghcr.io/romange/${{ matrix.container }}
options: --security-opt seccomp=unconfined --sysctl "net.ipv6.conf.all.disable_ipv6=0"
# Some tests which launch their own containers need a mounted volume to write through files
# into child containers
volumes:
- /mnt:/mnt
steps:
- uses: actions/checkout@v6
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 }}
# set WITH_SIMSIMD=OFF for fedora:30
if [ "${{ matrix.name }}" == 'rpm' ]; then
export WITH_SIMSIMD="OFF"
fi
./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: Save artifacts
run: |
# place all artifacts at the same location
set -eu
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@v7
with:
name: dragonfly-amd64-${{ matrix.name }}
path: results-artifacts/*
test-regression:
needs: [build-native, build-arm]
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- name: amd64
runner: ubuntu-latest
artifact: dragonfly-amd64-debian
binary: dragonfly-x86_64
- name: arm64
runner: ubuntu-24.04-arm
artifact: dragonfly-aarch64
binary: dragonfly-aarch64
container:
image: ghcr.io/romange/ubuntu-dev:24
options: --security-opt seccomp=unconfined --sysctl "net.ipv6.conf.all.disable_ipv6=0"
volumes:
- /mnt:/mnt
steps:
- uses: actions/checkout@v6
with:
submodules: true
- name: Download artifacts
uses: actions/download-artifact@v8
with:
name: ${{ matrix.artifact }}
path: results-artifacts
- name: Extract artifacts
run: |
set -eu
mkdir -p ${{ env.RELEASE_DIR }}
tar -xzf results-artifacts/dragonfly-*dbgsym.tar.gz -C ${{ env.RELEASE_DIR }}
ls -lh results-artifacts/
ls -lh ${{ env.RELEASE_DIR }}/
- name: Run regression tests
uses: ./.github/actions/regression-tests
with:
dfly-executable: dragonfly
gspace-secret: ${{ secrets.GSPACES_BOT_DF_BUILD }}
build-folder-name: ${{ env.RELEASE_DIR }}
filter: 'not debug_only'
publish_release:
runs-on: ubuntu-latest
needs: test-regression
steps:
- uses: actions/download-artifact@v8
name: Download files
with:
path: artifacts
- name: See all the artifacts
run: |
ls -lR artifacts/
- uses: ncipollo/release-action@v1.21.0
with:
artifacts: "artifacts/dragonfly-*/*"
allowUpdates: true
draft: true
updateOnlyUnreleased: true
skipIfReleaseExists: true
prerelease: true
omitNameDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}