mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 21:21:32 +00:00
chore: implement automatic releases
This commit is contained in:
2
.github/workflows/check.yml
vendored
2
.github/workflows/check.yml
vendored
@ -1,5 +1,5 @@
|
|||||||
name: check
|
name: check
|
||||||
on: [push, pull_request]
|
on: [push, pull_request, merge_group]
|
||||||
jobs:
|
jobs:
|
||||||
fmt:
|
fmt:
|
||||||
name: fmt
|
name: fmt
|
||||||
|
2
.github/workflows/client.yml
vendored
2
.github/workflows/client.yml
vendored
@ -1,5 +1,5 @@
|
|||||||
name: client
|
name: client
|
||||||
on: [push, pull_request]
|
on: [push, pull_request, merge_group]
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
|
2
.github/workflows/kernel.yml
vendored
2
.github/workflows/kernel.yml
vendored
@ -8,6 +8,8 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- "kernel/**"
|
- "kernel/**"
|
||||||
- "hack/ci/**"
|
- "hack/ci/**"
|
||||||
|
merge_group:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
12
.github/workflows/nightly.yml
vendored
12
.github/workflows/nightly.yml
vendored
@ -16,8 +16,6 @@ jobs:
|
|||||||
TARGET_ARCH: "${{ matrix.arch }}"
|
TARGET_ARCH: "${{ matrix.arch }}"
|
||||||
name: server ${{ matrix.arch }}
|
name: server ${{ matrix.arch }}
|
||||||
steps:
|
steps:
|
||||||
- run: git config --global core.autocrlf false && git config --global core.eol lf
|
|
||||||
if: ${{ matrix.platform.os == 'windows' }}
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
@ -77,6 +75,8 @@ jobs:
|
|||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
steps:
|
steps:
|
||||||
|
- run: git config --global core.autocrlf false && git config --global core.eol lf
|
||||||
|
if: ${{ matrix.platform.os == 'windows' }}
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
@ -93,4 +93,10 @@ jobs:
|
|||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: kratactl-${{ matrix.platform.os }}-${{ matrix.platform.arch }}
|
name: kratactl-${{ matrix.platform.os }}-${{ matrix.platform.arch }}
|
||||||
path: "target/*/release/kratactl*"
|
path: "target/*/release/kratactl"
|
||||||
|
if: ${{ matrix.platform.os != 'windows' }}
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: kratactl-${{ matrix.platform.os }}-${{ matrix.platform.arch }}
|
||||||
|
path: "target/*/release/kratactl.exe"
|
||||||
|
if: ${{ matrix.platform.os == 'windows' }}
|
||||||
|
1
.github/workflows/os.yml
vendored
1
.github/workflows/os.yml
vendored
@ -10,6 +10,7 @@ on:
|
|||||||
- "os/**"
|
- "os/**"
|
||||||
- "hack/os/**"
|
- "hack/os/**"
|
||||||
- "hack/ci/**"
|
- "hack/ci/**"
|
||||||
|
merge_group:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
91
.github/workflows/release-binaries.yml
vendored
Normal file
91
.github/workflows/release-binaries.yml
vendored
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
name: release-binaries
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types:
|
||||||
|
- published
|
||||||
|
env:
|
||||||
|
CARGO_INCREMENTAL: 0
|
||||||
|
CARGO_NET_GIT_FETCH_WITH_CLI: true
|
||||||
|
CARGO_NET_RETRY: 10
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
RUST_BACKTRACE: 1
|
||||||
|
RUSTUP_MAX_RETRIES: 10
|
||||||
|
jobs:
|
||||||
|
server:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
arch:
|
||||||
|
- x86_64
|
||||||
|
- aarch64
|
||||||
|
env:
|
||||||
|
TARGET_ARCH: "${{ matrix.arch }}"
|
||||||
|
name: server ${{ matrix.arch }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
with:
|
||||||
|
targets: "${{ matrix.arch }}-unknown-linux-gnu,${{ matrix.arch }}-unknown-linux-musl"
|
||||||
|
- run: ./hack/ci/install-linux-deps.sh
|
||||||
|
- run: ./hack/dist/bundle.sh
|
||||||
|
env:
|
||||||
|
KRATA_KERNEL_BUILD_JOBS: "5"
|
||||||
|
- run: "./hack/ci/assemble-release-assets.sh bundle-systemd ${{ github.event.release.tag_name }} ${{ matrix.arch }} target/dist/bundle-systemd-${{ matrix.arch }}.tgz"
|
||||||
|
- run: ./hack/dist/deb.sh
|
||||||
|
env:
|
||||||
|
KRATA_KERNEL_BUILD_SKIP: "1"
|
||||||
|
- run: "./hack/ci/assemble-release-assets.sh debian ${{ github.event.release.tag_name }} ${{ matrix.arch }} target/dist/*.deb"
|
||||||
|
- run: ./hack/dist/apk.sh
|
||||||
|
env:
|
||||||
|
KRATA_KERNEL_BUILD_SKIP: "1"
|
||||||
|
- run: "./hack/ci/assemble-release-assets.sh alpine ${{ github.event.release.tag_name }} ${{ matrix.arch }} target/dist/*_${{ matrix.arch }}.apk"
|
||||||
|
- run: ./hack/os/build.sh
|
||||||
|
env:
|
||||||
|
KRATA_KERNEL_BUILD_SKIP: "1"
|
||||||
|
- run: "./hack/ci/assemble-release-assets.sh os ${{ github.event.release.tag_name }} ${{ matrix.arch }} target/os/krata-${{ matrix.arch }}.qcow2"
|
||||||
|
client:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
platform:
|
||||||
|
- { os: linux, arch: x86_64, on: ubuntu-latest, deps: linux }
|
||||||
|
- { os: linux, arch: aarch64, on: ubuntu-latest, deps: linux }
|
||||||
|
- { os: darwin, arch: x86_64, on: macos-14, deps: darwin }
|
||||||
|
- { os: darwin, arch: aarch64, on: macos-14, deps: darwin }
|
||||||
|
- { os: freebsd, arch: x86_64, on: ubuntu-latest, deps: linux }
|
||||||
|
- { os: windows, arch: x86_64, on: windows-latest, deps: windows }
|
||||||
|
env:
|
||||||
|
TARGET_OS: "${{ matrix.platform.os }}"
|
||||||
|
TARGET_ARCH: "${{ matrix.platform.arch }}"
|
||||||
|
runs-on: "${{ matrix.platform.on }}"
|
||||||
|
name: client ${{ matrix.platform.os }}-${{ matrix.platform.arch }}
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
timeout-minutes: 60
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
if: ${{ matrix.platform.os != 'darwin' }}
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
with:
|
||||||
|
targets: "${{ matrix.platform.arch }}-apple-darwin"
|
||||||
|
if: ${{ matrix.platform.os == 'darwin' }}
|
||||||
|
- uses: homebrew/actions/setup-homebrew@master
|
||||||
|
if: ${{ matrix.platform.os == 'darwin' }}
|
||||||
|
- run: ./hack/ci/install-${{ matrix.platform.deps }}-deps.sh
|
||||||
|
- run: ./hack/build/cargo.sh build --release --bin kratactl
|
||||||
|
- run: "./hack/ci/assemble-release-assets.sh kratactl ${{ github.event.release.tag_name }} ${{ matrix.platform.os }}-${{ matrix.platform.arch }} target/*/release/kratactl"
|
||||||
|
if: ${{ matrix.platform.os != 'windows' }}
|
||||||
|
- run: "./hack/ci/assemble-release-assets.sh kratactl ${{ github.event.release.tag_name }} ${{ matrix.platform.os }}-${{ matrix.platform.arch }} target/*/release/kratactl.exe"
|
||||||
|
if: ${{ matrix.platform.os == 'windows' }}
|
||||||
|
- run: "./hack/ci/upload-release-assets.sh ${{ github.event.release.tag_name }}"
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
29
.github/workflows/release-plz.yml
vendored
Normal file
29
.github/workflows/release-plz.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
name: release-plz
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- release-test
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release-plz:
|
||||||
|
name: release-plz
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
- name: release-plz
|
||||||
|
uses: MarcoIeni/release-plz-action@v0.5
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
2
.github/workflows/server.yml
vendored
2
.github/workflows/server.yml
vendored
@ -1,5 +1,5 @@
|
|||||||
name: server
|
name: server
|
||||||
on: [push, pull_request]
|
on: [push, pull_request, merge_group]
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "krata-ctl"
|
name = "krata-ctl"
|
||||||
description = "Command-line tool to control the krata hypervisor"
|
description = "Command-line tool to control the krata hypervisor"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
version= "0.0.3"
|
version.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "krata-daemon"
|
name = "krata-daemon"
|
||||||
description = "Daemon for the krata hypervisor."
|
description = "Daemon for the krata hypervisor."
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
version= "0.0.3"
|
version.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "krata-guest"
|
name = "krata-guest"
|
||||||
description = "Guest services for the krata hypervisor."
|
description = "Guest services for the krata hypervisor."
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
version= "0.0.3"
|
version.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "krata"
|
name = "krata"
|
||||||
description = "Client library and common services for the krata hypervisor."
|
description = "Client library and common services for the krata hypervisor."
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
version= "0.0.3"
|
version.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "krata-network"
|
name = "krata-network"
|
||||||
description = "Networking services for the krata hypervisor."
|
description = "Networking services for the krata hypervisor."
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
version= "0.0.3"
|
version.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "krata-oci"
|
name = "krata-oci"
|
||||||
description = "OCI services for the krata hypervisor."
|
description = "OCI services for the krata hypervisor."
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
version= "0.0.3"
|
version.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "krata-runtime"
|
name = "krata-runtime"
|
||||||
description = "Runtime for running guests on the krata hypervisor."
|
description = "Runtime for running guests on the krata hypervisor."
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
version= "0.0.3"
|
version.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "krata-xencall"
|
name = "krata-xencall"
|
||||||
description = "An implementation of direct interfacing to xen privcmd for krata."
|
description = "An implementation of direct interfacing to xen privcmd for krata."
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
version= "0.0.3"
|
version.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "krata-xenclient"
|
name = "krata-xenclient"
|
||||||
description = "An implementation of Xen userspace for krata."
|
description = "An implementation of Xen userspace for krata."
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
version= "0.0.3"
|
version.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "krata-xenevtchn"
|
name = "krata-xenevtchn"
|
||||||
description = "An implementation of xen evtchn for krata."
|
description = "An implementation of xen evtchn for krata."
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
version= "0.0.3"
|
version.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "krata-xengnt"
|
name = "krata-xengnt"
|
||||||
description = "An implementation of xen grant interfaces for krata."
|
description = "An implementation of xen grant interfaces for krata."
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
version= "0.0.3"
|
version.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "krata-xenstore"
|
name = "krata-xenstore"
|
||||||
description = "A client that interacts with xenstore for krata."
|
description = "A client that interacts with xenstore for krata."
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
version= "0.0.3"
|
version.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
57
hack/ci/assemble-release-assets.sh
Executable file
57
hack/ci/assemble-release-assets.sh
Executable file
@ -0,0 +1,57 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
checksum_sha256() {
|
||||||
|
if type sha256sum > /dev/null 2>&1
|
||||||
|
then
|
||||||
|
sha256sum "${1}"
|
||||||
|
else
|
||||||
|
shasum -a 256 "${1}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
asset() {
|
||||||
|
cp "${1}" "${2}"
|
||||||
|
PREVIOUS="${PWD}"
|
||||||
|
cd "$(dirname "${2}")"
|
||||||
|
BASE_FILE_NAME="$(basename "${2}")"
|
||||||
|
checksum_sha256 "${BASE_FILE_NAME}" > "${BASE_FILE_NAME}.sha256"
|
||||||
|
cd "${PREVIOUS}"
|
||||||
|
}
|
||||||
|
|
||||||
|
FORM="${1}"
|
||||||
|
shift
|
||||||
|
TAG_NAME="${1}"
|
||||||
|
shift
|
||||||
|
PLATFORM="${1}"
|
||||||
|
shift
|
||||||
|
|
||||||
|
mkdir -p target/assets
|
||||||
|
|
||||||
|
for SOURCE_FILE_PATH in "${@}"
|
||||||
|
do
|
||||||
|
if [ "${FORM}" = "kratactl" ]
|
||||||
|
then
|
||||||
|
SUFFIX=""
|
||||||
|
if echo "${PLATFORM}" | grep "^windows-" > /dev/null
|
||||||
|
then
|
||||||
|
SUFFIX=".exe"
|
||||||
|
fi
|
||||||
|
asset "${SOURCE_FILE_PATH}" "target/assets/kratactl_${TAG_NAME}_${PLATFORM}${SUFFIX}"
|
||||||
|
elif [ "${FORM}" = "debian" ]
|
||||||
|
then
|
||||||
|
asset "${SOURCE_FILE_PATH}" "target/assets/krata_${TAG_NAME}_${PLATFORM}.deb"
|
||||||
|
elif [ "${FORM}" = "alpine" ]
|
||||||
|
then
|
||||||
|
asset "${SOURCE_FILE_PATH}" "target/assets/krata_${TAG_NAME}_${PLATFORM}.deb"
|
||||||
|
elif [ "${FORM}" = "bundle-systemd" ]
|
||||||
|
then
|
||||||
|
asset "${SOURCE_FILE_PATH}" "target/assets/krata-systemd_${TAG_NAME}_${PLATFORM}.tgz"
|
||||||
|
elif [ "${FORM}" = "os" ]
|
||||||
|
then
|
||||||
|
asset "${SOURCE_FILE_PATH}" "target/assets/krata_${TAG_NAME}_${PLATFORM}.qcow2"
|
||||||
|
else
|
||||||
|
echo "ERROR: Unknown form '${FORM}'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
0
hack/ci/install-windows-deps.sh
Normal file → Executable file
0
hack/ci/install-windows-deps.sh
Normal file → Executable file
22
hack/ci/upload-release-assets.sh
Executable file
22
hack/ci/upload-release-assets.sh
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
retry() {
|
||||||
|
for i in $(seq 1 10)
|
||||||
|
do
|
||||||
|
if "${@}"
|
||||||
|
then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
sleep "${i}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
"${@}"
|
||||||
|
}
|
||||||
|
|
||||||
|
TAG="${1}"
|
||||||
|
shift
|
||||||
|
|
||||||
|
cd target/assets
|
||||||
|
|
||||||
|
retry gh release upload "${TAG}" --clobber ./*
|
21
release-plz.toml
Normal file
21
release-plz.toml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
[workspace]
|
||||||
|
git_release_enable = false
|
||||||
|
git_tag_enable = false
|
||||||
|
changelog_update = false
|
||||||
|
publish = false
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "krata"
|
||||||
|
git_tag_name = "v${version}"
|
||||||
|
git_tag_enable = true
|
||||||
|
git_release_enable = true
|
||||||
|
changelog_update = true
|
||||||
|
changelog_path = "./CHANGELOG.md"
|
||||||
|
changelog_include = [
|
||||||
|
"krata-daemon",
|
||||||
|
"krata-ctl",
|
||||||
|
"krata-guest",
|
||||||
|
"krata-network",
|
||||||
|
"krata-runtime",
|
||||||
|
"krata-oci"
|
||||||
|
]
|
Reference in New Issue
Block a user