From 1259e6329501de70c080559e52a0dd568ccd5bf8 Mon Sep 17 00:00:00 2001 From: David Osipov Date: Mon, 23 Mar 2026 12:40:10 +0400 Subject: [PATCH] Add OpenBSD build job to CI workflows for x86_64 and aarch64 architectures --- .github/workflows/openbsd-build.yml | 69 +++++++++++++++++++++++++++++ .github/workflows/release.yml | 54 +++++++++++++++++++++- 2 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/openbsd-build.yml diff --git a/.github/workflows/openbsd-build.yml b/.github/workflows/openbsd-build.yml new file mode 100644 index 0000000..90ca265 --- /dev/null +++ b/.github/workflows/openbsd-build.yml @@ -0,0 +1,69 @@ +name: Build telemt for OpenBSD + +on: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: openbsd-build-${{ github.ref }} + cancel-in-progress: false + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + name: OpenBSD ${{ matrix.arch }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + include: + - arch: x86_64 + artifact: telemt-openbsd-x86_64 + rustflags: -C target-cpu=x86-64-v2 -C opt-level=3 + - arch: aarch64 + artifact: telemt-openbsd-aarch64 + rustflags: -C target-cpu=cortex-a53 -C target-feature=+aes,+pmull,+sha2,+sha1,+crc -C opt-level=3 + + permissions: + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + with: + fetch-depth: 1 + persist-credentials: false + clean: true + submodules: false + + - name: Compile in OpenBSD VM + uses: vmactions/openbsd-vm@3fafb45f2e2e696249c583835939323fe1c3448c # v1 + with: + release: "7.8" + arch: ${{ matrix.arch }} + usesh: true + sync: sshfs + envs: RUSTFLAGS CARGO_TERM_COLOR + prepare: | + pkg_add rust + run: | + set -e + cargo build --release --locked --verbose + env: + RUSTFLAGS: ${{ matrix.rustflags }} + + - name: Verify artifact exists + run: test -f target/release/telemt + + - name: Upload artifact + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: ${{ matrix.artifact }} + path: target/release/telemt + if-no-files-found: error + retention-days: 7 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index def299d..086914d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -206,6 +206,58 @@ jobs: dist/${{ matrix.asset }}.tar.gz dist/${{ matrix.asset }}.sha256 +# ========================== +# OpenBSD +# ========================== + build-openbsd: + name: OpenBSD ${{ matrix.arch }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + include: + - arch: x86_64 + asset: telemt-x86_64-openbsd + rustflags: -C target-cpu=x86-64-v2 -C opt-level=3 + - arch: aarch64 + asset: telemt-aarch64-openbsd + rustflags: -C target-cpu=cortex-a53 -C target-feature=+aes,+pmull,+sha2,+sha1,+crc -C opt-level=3 + + steps: + - uses: actions/checkout@v4 + + - name: Build in OpenBSD VM + uses: vmactions/openbsd-vm@v1 + with: + release: "7.8" + arch: ${{ matrix.arch }} + usesh: true + sync: sshfs + envs: RUSTFLAGS CARGO_TERM_COLOR + prepare: | + pkg_add rust + run: | + set -e + cargo build --release --locked --verbose + env: + RUSTFLAGS: ${{ matrix.rustflags }} + + - name: Package + run: | + mkdir -p dist + cp target/release/${{ env.BINARY_NAME }} dist/${{ env.BINARY_NAME }}-${{ matrix.arch }}-unknown-openbsd + cd dist + tar -czf ${{ matrix.asset }}.tar.gz ${{ env.BINARY_NAME }}-${{ matrix.arch }}-unknown-openbsd + sha256sum ${{ matrix.asset }}.tar.gz > ${{ matrix.asset }}.sha256 + + - uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.asset }} + path: | + dist/${{ matrix.asset }}.tar.gz + dist/${{ matrix.asset }}.sha256 + # ========================== # Docker # ========================== @@ -261,7 +313,7 @@ jobs: release: name: Release runs-on: ubuntu-latest - needs: [build-gnu, build-musl] + needs: [build-gnu, build-musl, build-openbsd] permissions: contents: write