mirror of
https://github.com/mailscope/kumomta.git
synced 2026-09-09 12:02:14 +00:00
107 lines
3.0 KiB
YAML
107 lines
3.0 KiB
YAML
name: Rocky and Mariner
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "20*"
|
|
branches: [ "main" ]
|
|
paths:
|
|
- "crates/**/*.rs"
|
|
- ".github/workflows/rocky.yml"
|
|
- "**/Cargo.toml"
|
|
- "get-deps.sh"
|
|
- "assets/build-rpm.sh"
|
|
- "assets/sign-rpm.sh"
|
|
- "assets/policy-extras/**"
|
|
- "assets/bounce_classifier/**"
|
|
- "assets/upload-package.sh"
|
|
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
paths:
|
|
- "crates/**/*.rs"
|
|
- ".github/workflows/rocky.yml"
|
|
- "**/Cargo.toml"
|
|
- "get-deps.sh"
|
|
- "assets/build-rpm.sh"
|
|
- "assets/sign-rpm.sh"
|
|
- "assets/policy-extras/**"
|
|
- "assets/bounce_classifier/**"
|
|
- "assets/upload-package.sh"
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
build-rocky:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
container:
|
|
- "rockylinux:8"
|
|
- "rockylinux:9"
|
|
#- "mcr.microsoft.com/cbl-mariner/base/core:2.0"
|
|
container:
|
|
image: ${{ matrix.container }}
|
|
options: --privileged
|
|
|
|
steps:
|
|
- name: "Install git"
|
|
shell: bash
|
|
# Mariner uses yum rather than dnf
|
|
run: "dnf install -y git || yum install -y git"
|
|
- name: "Install Hashicorp Vault"
|
|
run: |
|
|
dnf install -y yum-utils || yum install -y yum-utils
|
|
yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
|
|
dnf install -y vault || yum install -y vault
|
|
- name: "Install Rust"
|
|
uses: dtolnay/rust-toolchain@stable
|
|
- uses: actions/checkout@v3
|
|
- name: workaround git permission guff
|
|
run: git config --global --add safe.directory /__w/kumomta/kumomta
|
|
- name: Get Deps
|
|
run: bash ./get-deps.sh
|
|
- name: Install cargo-nextest
|
|
uses: baptiste0928/cargo-install@v2
|
|
with:
|
|
crate: cargo-nextest
|
|
cache-key: ${{ matrix.container }}
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
cache-on-failure: true
|
|
env-vars: "CARGO RUST"
|
|
key: ${{ matrix.container }}
|
|
- name: Build
|
|
run: cargo build --release
|
|
- name: Run tests
|
|
run: cargo nextest run --release
|
|
- name: "Build RPM"
|
|
env:
|
|
REF_TYPE: ${{ github.ref_type }}
|
|
run: "./assets/build-rpm.sh"
|
|
- name: "Move RPM"
|
|
run: "mv ~/rpmbuild/RPMS/*/*.rpm ."
|
|
- name: "Sign"
|
|
if: ${{ github.ref == 'refs/heads/main' || github.ref_type == 'tag' }}
|
|
env:
|
|
PUB: ${{ secrets.OPENREPO_GPG_PUBLIC }}
|
|
PRIV: ${{ secrets.OPENREPO_GPG_PRIVATE }}
|
|
TOKEN: ${{ secrets.OPENREPO_API_TOKEN }}
|
|
REF_TYPE: ${{ github.ref_type }}
|
|
shell: bash
|
|
run: |
|
|
./assets/sign-rpm.sh *.rpm
|
|
./assets/upload-package.sh ${{ matrix.container }} *.rpm
|
|
- name: Make artifact name
|
|
id: artifact-name
|
|
run: echo "name=${{ matrix.container }}" | tr ':' '-' >> $GITHUB_OUTPUT
|
|
- name: "Upload artifact"
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ steps.artifact-name.outputs.name }}
|
|
path: "*.rpm"
|
|
|
|
|