Skip to content

Commit bf5d4dd

Browse files
committed
docs(main): support arm64 release docs
Signed-off-by: cuisongliu <cuisongliu@qq.com>
1 parent 3c7cc26 commit bf5d4dd

4 files changed

Lines changed: 63 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,41 @@ jobs:
9595
token: ${{ secrets.GITHUB_TOKEN }}
9696
files: ./${{ env.OUTPUTDIR }}.tar.gz
9797

98+
docs-pull-request:
99+
name: Create Docs Pull Request
100+
runs-on: ubuntu-20.04
101+
needs:
102+
- release
103+
steps:
104+
- uses: actions/checkout@v3
105+
106+
- name: Determine Release Info
107+
id: info
108+
env:
109+
GITHUB_REF: ${{ github.ref }}
110+
run: |
111+
VERSION=${GITHUB_REF##*v}
112+
MAJOR=${VERSION%%.*}
113+
MINOR=${VERSION%.*}
114+
MINOR=${MINOR#*.}
115+
PATCH=${VERSION##*.}
116+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
117+
echo "OUTPUTDIR=youki_${MAJOR}_${MINOR}_${PATCH}_linux" >> $GITHUB_ENV
118+
echo "INNERDIR=youki-${VERSION}" >> $GITHUB_ENV
119+
- name: Generator docs
120+
run: ./scripts/release_tag.sh ${{ env.VERSION }}
121+
- uses: peter-evans/create-pull-request@v5
122+
with:
123+
title: 'docs: Automated docs Update for ${{ env.VERSION }}'
124+
body: |
125+
126+
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
127+
commit-message: |
128+
🤖 Automatically updates the version numbers in download links within the documentation.
129+
branch: docs-${{ env.VERSION }}
130+
base: main
131+
signoff: true
132+
delete-branch: true
98133
publish:
99134
name: Publish Packages
100135
needs: check

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ tags.temp
2222
/test.log
2323

2424
/tests/k8s/_out/
25+
replace_content.txt

docs/src/user/basic_setup.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,15 @@ $ sudo dnf install \
4646
Install from the GitHub release.
4747
Note that this way also requires the aforementioned installation.
4848

49+
<!--youki release begin-->
4950
```console
50-
$ wget https://github.com/containers/youki/releases/download/v0.3.0/youki_0_3_0_linux.tar.gz
51-
$ tar -zxvf youki_0_3_0_linux.tar.gz youki_0_3_0_linux/youki-0.3.0/youki
51+
$ 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
52+
$ tar -zxvf youki_0_3_0_linux.tar.gz --strip-components=1
5253
# Maybe you need root privileges.
53-
$ mv youki_0_3_0_linux/youki-0.3.0/youki /usr/local/bin/youki
54-
$ rm -rf youki_0_3_0_linux.tar.gz youki_0_3_0_linux
54+
$ mv youki-0.3.0/youki /usr/local/bin/youki
55+
$ rm -rf youki_0_3_0_linux.tar.gz youki-0_3_0
5556
```
57+
<!--youki release end-->
5658

5759
## Getting the source
5860

scripts/release_tag.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
TAG=${1:-0.3.1}
4+
5+
START_MARKER="<!--youki release begin-->"
6+
END_MARKER="<!--youki release end-->"
7+
8+
9+
echo "\`\`\`console
10+
\$ wget -qO youki_${TAG}_linux.tar.gz https://github.com/containers/youki/releases/download/v${TAG}/youki_${TAG}_linux-\$(uname -m).tar.gz
11+
\$ tar -zxvf youki_${TAG}_linux.tar.gz --strip-components=1
12+
# Maybe you need root privileges.
13+
\$ mv youki-${TAG}/youki /usr/local/bin/youki
14+
\$ rm -rf youki_${TAG}_linux.tar.gz youki-${TAG}
15+
\`\`\`" > replace_content.txt
16+
17+
awk -v start="$START_MARKER" -v end="$END_MARKER" -v newfile="replace_content.txt" '
18+
BEGIN {printing=1}
19+
$0 ~ start {print;system("cat " newfile);printing=0}
20+
$0 ~ end {printing=1}
21+
printing' docs/src/user/basic_setup.md > temp.txt && mv temp.txt docs/src/user/basic_setup.md

0 commit comments

Comments
 (0)