From d65d383482be268e58bbd74b4d5e82f997cadf35 Mon Sep 17 00:00:00 2001 From: cuisongliu Date: Mon, 6 Nov 2023 19:33:12 +0800 Subject: [PATCH 1/3] docs(main): support arm64 release docs Signed-off-by: cuisongliu --- .github/workflows/release.yml | 35 +++++++++++++++++++++++++++++++++++ .gitignore | 1 + docs/src/user/basic_setup.md | 10 ++++++---- scripts/release_tag.sh | 21 +++++++++++++++++++++ 4 files changed, 63 insertions(+), 4 deletions(-) create mode 100755 scripts/release_tag.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0fe19f2ce..8a9cabfa2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -102,6 +102,41 @@ jobs: ./${{ env.OUTPUTDIR }}-x86_64.tar.gz ./${{ env.OUTPUTDIR }}-aarch64.tar.gz + docs-pull-request: + name: Create Docs Pull Request + runs-on: ubuntu-22.04 + needs: + - release + steps: + - uses: actions/checkout@v3 + + - name: Determine Release Info + id: info + env: + GITHUB_REF: ${{ github.ref }} + run: | + VERSION=${GITHUB_REF##*v} + MAJOR=${VERSION%%.*} + MINOR=${VERSION%.*} + MINOR=${MINOR#*.} + PATCH=${VERSION##*.} + echo "VERSION=${VERSION}" >> $GITHUB_ENV + echo "OUTPUTDIR=youki_${MAJOR}_${MINOR}_${PATCH}_linux" >> $GITHUB_ENV + echo "INNERDIR=youki-${VERSION}" >> $GITHUB_ENV + - name: Generator docs + run: ./scripts/release_tag.sh ${{ env.VERSION }} + - uses: peter-evans/create-pull-request@v5 + with: + title: 'docs: Automated docs Update for ${{ env.VERSION }}' + body: | + + Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action + commit-message: | + 🤖 Automatically updates the version numbers in download links within the documentation. + branch: docs-${{ env.VERSION }} + base: main + signoff: true + delete-branch: true publish: name: Publish Packages needs: build diff --git a/.gitignore b/.gitignore index fdeed4a22..5dc6a0717 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ tags.temp /test.log /tests/k8s/_out/ +replace_content.txt \ No newline at end of file diff --git a/docs/src/user/basic_setup.md b/docs/src/user/basic_setup.md index c323de6e8..4b96ec8fd 100644 --- a/docs/src/user/basic_setup.md +++ b/docs/src/user/basic_setup.md @@ -46,13 +46,15 @@ $ sudo dnf install \ Install from the GitHub release. Note that this way also requires the aforementioned installation. + ```console -$ wget https://github.com/containers/youki/releases/download/v0.3.0/youki_0_3_0_linux.tar.gz -$ tar -zxvf youki_0_3_0_linux.tar.gz youki_0_3_0_linux/youki-0.3.0/youki +$ wget -qO youki_0_3_0_linux.tar.gz https://github.com/containers/youki/releases/download/v0.3.0/youki_0_3_0_linux.tar.gz +$ tar -zxvf youki_0_3_0_linux.tar.gz --strip-components=1 # Maybe you need root privileges. -$ mv youki_0_3_0_linux/youki-0.3.0/youki /usr/local/bin/youki -$ rm -rf youki_0_3_0_linux.tar.gz youki_0_3_0_linux +$ mv youki-0.3.0/youki /usr/local/bin/youki +$ rm -rf youki_0_3_0_linux.tar.gz youki-0_3_0 ``` + ## Getting the source diff --git a/scripts/release_tag.sh b/scripts/release_tag.sh new file mode 100755 index 000000000..00e277fa1 --- /dev/null +++ b/scripts/release_tag.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +TAG=${1:-0.3.1} + +START_MARKER="" +END_MARKER="" + + +echo "\`\`\`console +\$ wget -qO youki_${TAG}_linux.tar.gz https://github.com/containers/youki/releases/download/v${TAG}/youki_${TAG}_linux-\$(uname -m).tar.gz +\$ tar -zxvf youki_${TAG}_linux.tar.gz --strip-components=1 +# Maybe you need root privileges. +\$ mv youki-${TAG}/youki /usr/local/bin/youki +\$ rm -rf youki_${TAG}_linux.tar.gz youki-${TAG} +\`\`\`" > replace_content.txt + +awk -v start="$START_MARKER" -v end="$END_MARKER" -v newfile="replace_content.txt" ' +BEGIN {printing=1} +$0 ~ start {print;system("cat " newfile);printing=0} +$0 ~ end {printing=1} +printing' docs/src/user/basic_setup.md > temp.txt && mv temp.txt docs/src/user/basic_setup.md From 0b519e52a021543e4033eb52cf551d3a7c4e5ac9 Mon Sep 17 00:00:00 2001 From: cuisongliu Date: Sat, 18 Nov 2023 11:32:38 +0800 Subject: [PATCH 2/3] docs(main): support arm64 release docs Signed-off-by: cuisongliu --- .github/workflows/release.yml | 36 ----------------------------------- justfile | 4 +--- scripts/release_tag.sh | 7 ++++++- 3 files changed, 7 insertions(+), 40 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8a9cabfa2..6226ef05d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -101,42 +101,6 @@ jobs: files: | ./${{ env.OUTPUTDIR }}-x86_64.tar.gz ./${{ env.OUTPUTDIR }}-aarch64.tar.gz - - docs-pull-request: - name: Create Docs Pull Request - runs-on: ubuntu-22.04 - needs: - - release - steps: - - uses: actions/checkout@v3 - - - name: Determine Release Info - id: info - env: - GITHUB_REF: ${{ github.ref }} - run: | - VERSION=${GITHUB_REF##*v} - MAJOR=${VERSION%%.*} - MINOR=${VERSION%.*} - MINOR=${MINOR#*.} - PATCH=${VERSION##*.} - echo "VERSION=${VERSION}" >> $GITHUB_ENV - echo "OUTPUTDIR=youki_${MAJOR}_${MINOR}_${PATCH}_linux" >> $GITHUB_ENV - echo "INNERDIR=youki-${VERSION}" >> $GITHUB_ENV - - name: Generator docs - run: ./scripts/release_tag.sh ${{ env.VERSION }} - - uses: peter-evans/create-pull-request@v5 - with: - title: 'docs: Automated docs Update for ${{ env.VERSION }}' - body: | - - Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action - commit-message: | - 🤖 Automatically updates the version numbers in download links within the documentation. - branch: docs-${{ env.VERSION }} - base: main - signoff: true - delete-branch: true publish: name: Publish Packages needs: build diff --git a/justfile b/justfile index 214efacc1..6d5162b8a 100644 --- a/justfile +++ b/justfile @@ -190,6 +190,4 @@ ci-musl-prepare: ci-prepare exit 1 version-up version: - git grep -l "^version = .* # MARK: Version" | xargs sed -i 's/version = "[0-9]\.[0-9]\.[0-9]" # MARK: Version/version = "{{version}}" # MARK: Version/g' - sed -i s/_[0-9]_[0-9]_[0-9]_/_{{ replace(version, '.', '_') }}_/g docs/src/user/basic_setup.md - sed -i 's/[0-9]\.[0-9]\.[0-9]/{{version}}/g' docs/src/user/basic_setup.md + {{ cwd }}/scripts/release_tag.sh {{version}} \ No newline at end of file diff --git a/scripts/release_tag.sh b/scripts/release_tag.sh index 00e277fa1..c7299e83b 100755 --- a/scripts/release_tag.sh +++ b/scripts/release_tag.sh @@ -1,6 +1,11 @@ #!/bin/bash -TAG=${1:-0.3.1} +TAG=${1} + +if [ -z "$TAG" ]; then + echo "Error: No version number provided." + exit 1 +fi START_MARKER="" END_MARKER="" From a3a2b2b8613cf5bafdbaf66f8a2c07a200b25335 Mon Sep 17 00:00:00 2001 From: cuisongliu Date: Sat, 18 Nov 2023 12:03:46 +0800 Subject: [PATCH 3/3] docs(main): support arm64 release docs Signed-off-by: cuisongliu --- crates/libcontainer/Cargo.toml | 2 +- crates/youki/Cargo.toml | 14 +++++++------- justfile | 2 ++ scripts/release_tag.sh | 13 +++++++++---- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/crates/libcontainer/Cargo.toml b/crates/libcontainer/Cargo.toml index b2dca140a..abc4b917c 100644 --- a/crates/libcontainer/Cargo.toml +++ b/crates/libcontainer/Cargo.toml @@ -43,7 +43,7 @@ oci-spec = { version = "~0.6.4", features = ["runtime"] } once_cell = "1.18.0" procfs = "0.16.0" prctl = "1.0.0" -libcgroups = { version = "0.3.0", path = "../libcgroups", default-features = false } +libcgroups = { path = "../libcgroups", default-features = false, version = "0.3.0" } # MARK: Version libseccomp = { version = "0.3.0", optional = true } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/crates/youki/Cargo.toml b/crates/youki/Cargo.toml index 5da06f135..223322cf0 100644 --- a/crates/youki/Cargo.toml +++ b/crates/youki/Cargo.toml @@ -29,9 +29,9 @@ features = ["std", "suggestions", "derive", "cargo", "help", "usage", "error-con [dependencies] anyhow = "1.0.75" chrono = { version = "0.4", default-features = false, features = ["clock", "serde"] } -libcgroups = { version = "0.3.0", path = "../libcgroups", default-features = false } -libcontainer = { version = "0.3.0", path = "../libcontainer", default-features = false } -liboci-cli = { version = "0.3.0", path = "../liboci-cli" } +libcgroups = { path = "../libcgroups", default-features = false, version = "0.3.0" } # MARK: Version +libcontainer = { path = "../libcontainer", default-features = false, version = "0.3.0" } # MARK: Version +liboci-cli = { path = "../liboci-cli", version = "0.3.0" } # MARK: Version nix = "0.27.1" once_cell = "1.18.0" pentacle = "1.0.0" @@ -44,9 +44,9 @@ caps = "0.5.5" wasmer = { version = "4.0.0", optional = true } wasmer-wasix = { version = "0.9.0", optional = true } wasmedge-sdk = { version = "0.13.2", optional = true } -wasmtime = {version = "10.0.2", optional = true } -wasmtime-wasi = {version = "10.0.2", optional = true } -tracing = { version = "0.1.40", features = ["attributes"]} +wasmtime = { version = "10.0.2", optional = true } +wasmtime-wasi = { version = "10.0.2", optional = true } +tracing = { version = "0.1.40", features = ["attributes"] } tracing-subscriber = { version = "0.3.18", features = ["json", "env-filter"] } tracing-journald = "0.3.0" @@ -57,4 +57,4 @@ scopeguard = "1.2.0" [build-dependencies] anyhow = "1.0.75" -vergen = {version ="8.2.6", features =["git","gitcl"]} +vergen = { version = "8.2.6", features = ["git", "gitcl"] } diff --git a/justfile b/justfile index 6d5162b8a..321d580a6 100644 --- a/justfile +++ b/justfile @@ -190,4 +190,6 @@ ci-musl-prepare: ci-prepare exit 1 version-up version: + git grep -l "^version = .* # MARK: Version" | xargs sed -i 's/version = "[0-9]\.[0-9]\.[0-9]" # MARK: Version/version = "{{version}}" # MARK: Version/g' + git grep -l "} # MARK: Version" | grep -v justfile | xargs sed -i 's/version = "[0-9]\.[0-9]\.[0-9]" } # MARK: Version/version = "{{version}}" } # MARK: Version/g' {{ cwd }}/scripts/release_tag.sh {{version}} \ No newline at end of file diff --git a/scripts/release_tag.sh b/scripts/release_tag.sh index c7299e83b..4882c8077 100755 --- a/scripts/release_tag.sh +++ b/scripts/release_tag.sh @@ -6,17 +6,22 @@ if [ -z "$TAG" ]; then echo "Error: No version number provided." exit 1 fi +VERSION=${TAG##*v} +MAJOR=${VERSION%%.*} +MINOR=${VERSION%.*} +MINOR=${MINOR#*.} +PATCH=${VERSION##*.} START_MARKER="" END_MARKER="" echo "\`\`\`console -\$ wget -qO youki_${TAG}_linux.tar.gz https://github.com/containers/youki/releases/download/v${TAG}/youki_${TAG}_linux-\$(uname -m).tar.gz -\$ tar -zxvf youki_${TAG}_linux.tar.gz --strip-components=1 +\$ wget -qO youki_${VERSION}_linux.tar.gz https://github.com/containers/youki/releases/download/v${VERSION}/youki_${MAJOR}_${MINOR}_${PATCH}_linux-\$(uname -m).tar.gz +\$ tar -zxvf youki_${VERSION}_linux.tar.gz --strip-components=1 # Maybe you need root privileges. -\$ mv youki-${TAG}/youki /usr/local/bin/youki -\$ rm -rf youki_${TAG}_linux.tar.gz youki-${TAG} +\$ mv youki-${VERSION}/youki /usr/local/bin/youki +\$ rm -rf youki_${VERSION}_linux.tar.gz youki-${VERSION} \`\`\`" > replace_content.txt awk -v start="$START_MARKER" -v end="$END_MARKER" -v newfile="replace_content.txt" '