Skip to content

Commit

Permalink
Merge pull request #1397 from YJDoc2/fix_release_script
Browse files Browse the repository at this point in the history
Fix release script and prepare for release
  • Loading branch information
utam0k authored Dec 13, 2022
2 parents 3df2dcb + 7b7e468 commit 174448a
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 52 deletions.
54 changes: 21 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
with:
submodules: recursive
- run: sudo apt-get -y update
- run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev libseccomp-dev
- run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev libseccomp-dev libclang-dev
- name: Set up cargo
uses: actions-rs/toolchain@v1
with:
Expand All @@ -22,7 +22,7 @@ jobs:
- name: Build
run: make youki-release
- name: test
run: make test-all
run: make unittest featuretest oci-tests

upload:
name: Upload
Expand All @@ -38,7 +38,7 @@ jobs:
toolchain: stable
override: true
- name: Release build
run: make release-build
run: make youki-release
- name: Create output directory
run: mkdir output
- name: Copy files to output
Expand All @@ -47,18 +47,16 @@ jobs:
cp README.md output/README.md
cp LICENSE output/LICENSE
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: output
path: output/*

release:
name: Publish Release
name: Create Draft Release
runs-on: ubuntu-20.04
needs:
- upload
outputs:
version: ${{ steps.info.outputs.version }}
steps:
- uses: actions/checkout@v3

Expand All @@ -72,43 +70,31 @@ jobs:
MINOR=${VERSION%.*}
MINOR=${MINOR#*.}
PATCH=${VERSION##*.}
echo "::set-output name=version::${VERSION}"
echo "::set-output name=outputdir::youki_${MAJOR}_${MINOR}_${PATCH}_linux"
echo "::set-output name=innerdir::youki-${VERSION}"
- name: Create Release Draft
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ steps.info.outputs.version }} Release
draft: true
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "OUTPUTDIR=youki_${MAJOR}_${MINOR}_${PATCH}_linux" >> $GITHUB_ENV
echo "INNERDIR=youki-${VERSION}" >> $GITHUB_ENV
- name: Create Output Directory
run: mkdir -p ${{ steps.info.outputs.outputdir }}/${{ steps.info.outputs.innerdir }}
run: mkdir -p ${{ env.OUTPUTDIR }}/${{ env.INNERDIR }}

- name: Download Linux Artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: output
path: ${{ steps.info.outputs.outputdir }}/${{ steps.info.outputs.innerdir }}
path: ${{ env.OUTPUTDIR }}/${{ env.INNERDIR }}

- name: Restore File Modes
run: |
chmod 755 ${{ steps.info.outputs.outputdir }}/${{ steps.info.outputs.innerdir }}/youki
chmod 755 ${{ env.OUTPUTDIR }}/${{ env.INNERDIR }}/youki
- name: Create tarball
run: tar -zcvf ${{ steps.info.outputs.outputdir }}.tar.gz ${{ steps.info.outputs.outputdir }}

- name: Upload Artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: tar -zcvf ${{ env.OUTPUTDIR }}.tar.gz ${{ env.OUTPUTDIR }}
- name: Create Release Draft
uses: softprops/action-gh-release@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ steps.info.outputs.outputdir }}.tar.gz
asset_name: ${{ steps.info.outputs.outputdir }}.tar.gz
asset_content_type: application/gzip
name: ${{ env.VERSION }} Release
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
files: ./${{ env.OUTPUTDIR }}.tar.gz

publish:
name: Publish Packages
Expand All @@ -129,3 +115,5 @@ jobs:
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
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ all: youki-release rust-oci-tests-bin runtimetest

# Tests
unittest:
cd ./crates && cargo test --all-targets --all-features
cd ./crates && LD_LIBRARY_PATH=${HOME}/.wasmedge/lib cargo test --all --all-targets --all-features

featuretest:
./scripts/features_test.sh
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ $ sudo apt-get install \
libdbus-glib-1-dev \
build-essential \
libelf-dev \
libseccomp-dev
libseccomp-dev \
libclang-dev
```

### Fedora, Centos, RHEL and related distributions
Expand All @@ -162,7 +163,8 @@ $ sudo dnf install \
systemd-devel \
dbus-devel \
elfutils-libelf-devel \
libseccomp-devel
libseccomp-devel \
libclang-dev
```

## Build
Expand Down
2 changes: 1 addition & 1 deletion crates/libcgroups/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libcgroups"
version = "0.0.3"
version = "0.0.4"
description = "Library for cgroup"
license-file = "../../LICENSE"
repository = "https://github.com/containers/youki"
Expand Down
6 changes: 3 additions & 3 deletions crates/libcontainer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libcontainer"
version = "0.0.3"
version = "0.0.4"
description = "Library for container control"
license-file = "../../LICENSE"
repository = "https://github.com/containers/youki"
Expand Down Expand Up @@ -36,15 +36,15 @@ oci-spec = { version = "0.5.8", features = ["runtime"] }
path-clean = "0.1.0"
procfs = "0.14.1"
prctl = "1.0.0"
libcgroups = { version = "0.0.3", path = "../libcgroups", default-features = false }
libcgroups = { version = "0.0.4", path = "../libcgroups", default-features = false }
libseccomp = { version = "0.3.0" }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
syscalls = "0.6.7"
rust-criu = "0.2.0"
wasmer = { version = "2.2.0", optional = true }
wasmer-wasi = { version = "2.3.0", optional = true }
wasmedge-sdk = { version = "0.7.1", optional = true }
wasmedge-sdk = { version = "0.7.1", optional = true}

[dev-dependencies]
oci-spec = { version = "0.5.8", features = ["proptests", "runtime"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/liboci-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "liboci-cli"
version = "0.0.3"
version = "0.0.4"
description = "Parse command line arguments for OCI container runtimes"
license-file = "../../LICENSE"
repository = "https://github.com/containers/youki"
Expand Down
8 changes: 4 additions & 4 deletions crates/youki/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "youki"
version = "0.0.3"
version = "0.0.4"
description = "A container runtime written in Rust"
license-file = "../../LICENSE"
repository = "https://github.com/containers/youki"
Expand All @@ -25,9 +25,9 @@ features = ["std", "suggestions", "derive", "cargo"]
[dependencies]
anyhow = "1.0.65"
chrono = { version = "0.4", features = ["serde"] }
libcgroups = { version = "0.0.3", path = "../libcgroups", default-features = false }
libcontainer = { version = "0.0.3", path = "../libcontainer", default-features = false }
liboci-cli = { version = "0.0.3", path = "../liboci-cli" }
libcgroups = { version = "0.0.4", path = "../libcgroups", default-features = false }
libcontainer = { version = "0.0.4", path = "../libcontainer", default-features = false }
liboci-cli = { version = "0.0.4", path = "../liboci-cli" }
log = { version = "0.4", features = ["std"] }
nix = "0.25.0"
oci-spec = { version = "0.5.8", features = ["runtime"] }
Expand Down
6 changes: 4 additions & 2 deletions docs/src/user/basic_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ $ sudo apt-get install \
libdbus-glib-1-dev \
build-essential \
libelf-dev \
libseccomp-dev
libseccomp-dev \
libclang-dev
```

#### Fedora, Centos, RHEL and related distributions
Expand All @@ -34,7 +35,8 @@ $ sudo dnf install \
systemd-devel \
dbus-devel \
elfutils-libelf-devel \
libseccomp-devel
libseccomp-devel \
libclang-dev
```

---
Expand Down
2 changes: 1 addition & 1 deletion tests/rust-integration-tests/runtimetest/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub fn validate_hostname(spec: &Spec) {
}
let actual_hostname = nix::unistd::gethostname().expect("failed to get current hostname");
let actual_hostname = actual_hostname.to_str().unwrap();
if &actual_hostname != expected_hostname {
if actual_hostname != expected_hostname {
eprintln!(
"Unexpected hostname, expected: {:?} found: {:?}",
expected_hostname, actual_hostname
Expand Down

0 comments on commit 174448a

Please sign in to comment.