mirror of
https://github.com/containers/youki
synced 2025-12-31 04:31:44 +01:00
* update rust version to 1.85.0 Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com> * ci: add rustflags to make cross rs work properly Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com> --------- Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
112 lines
3.5 KiB
YAML
112 lines
3.5 KiB
YAML
name: 🚀 Release
|
|
|
|
on:
|
|
push:
|
|
tags: ["v[0-9]+.[0-9]+.[0-9]+*"]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
parse:
|
|
runs-on: ubuntu-latest
|
|
name: Parse ref
|
|
outputs:
|
|
version: ${{ steps.parse.outputs.version }}
|
|
steps:
|
|
- id: parse
|
|
name: Parse ref
|
|
run: echo "version=${GITHUB_REF##refs/tags/v}" >> ${GITHUB_OUTPUT}
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-24.04
|
|
needs:
|
|
- parse
|
|
strategy:
|
|
matrix:
|
|
arch: [ "x86_64", "aarch64" ]
|
|
libc: [ "gnu", "musl" ]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
- name: Setup Rust toolchain and cache
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
env:
|
|
RUST_CACHE_KEY_OS: rust-cache-${{ matrix.arch }}-${{ matrix.libc }}
|
|
- name: Install just
|
|
uses: taiki-e/install-action@just
|
|
- name: Install cross-rs
|
|
run: RUSTFLAGS="" cargo install cross --git https://github.com/cross-rs/cross
|
|
- name: Setup target
|
|
run: |
|
|
echo "CARGO=cross" >> ${GITHUB_ENV}
|
|
echo "TARGET=${{ matrix.arch }}-unknown-linux-${{ matrix.libc }}" >> ${GITHUB_ENV}
|
|
- name: Release build
|
|
run: just youki-release
|
|
- name: Disable AppArmor restrictions
|
|
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
|
|
- name: test
|
|
# TODO(utam0k): The feature test needs nightly
|
|
# run: just test-basic featuretest test-oci
|
|
if: ${{ matrix.arch == 'x86_64' }}
|
|
run: just test-basic test-oci
|
|
- name: Create output directory
|
|
run: mkdir output
|
|
- name: Create artifact
|
|
run: tar -zcvf youki-${{ needs.parse.outputs.version }}-${{ matrix.arch }}-${{ matrix.libc }}.tar.gz youki README.md LICENSE
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: youki-${{ matrix.arch }}-${{ matrix.libc }}
|
|
path: youki-${{ needs.parse.outputs.version }}-${{ matrix.arch }}-${{ matrix.libc }}.tar.gz
|
|
|
|
release:
|
|
name: Create Draft Release
|
|
environment:
|
|
name: release
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
contents: write
|
|
needs:
|
|
- parse
|
|
- build
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Create artifacts directory
|
|
run: mkdir -p artifacts
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
- name: Show artifacts
|
|
run: ls -alhR artifacts
|
|
- name: Create release draft
|
|
shell: bash
|
|
run: |
|
|
set -x
|
|
gh release create "${{ github.ref }}" --generate-notes --draft
|
|
gh release upload "${{ github.ref }}" artifacts/*/*
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
RELEASE_NAME: "${{ needs.parse.outputs.version }} Release"
|
|
|
|
publish:
|
|
name: Publish Packages
|
|
needs: release
|
|
runs-on: ubuntu-24.04
|
|
if: ${{ github.repository == 'youki-dev/youki' }}
|
|
env:
|
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Rust toolchain and cache
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
- name: Publish libcgroups
|
|
run: cargo publish -p libcgroups --no-verify
|
|
- name: Publish libcontainer
|
|
run: cargo publish -p libcontainer --no-verify
|
|
- name: Publish liboci-cli
|
|
run: cargo publish -p liboci-cli --no-verify
|
|
- name: Publish youki
|
|
run: cargo publish -p youki --no-verify
|