Skip to content

Commit

Permalink
docs(main): support arm64 release docs
Browse files Browse the repository at this point in the history
Signed-off-by: cuisongliu <[email protected]>
  • Loading branch information
cuisongliu committed Nov 18, 2023
1 parent 08c0a23 commit d65d383
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 4 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ tags.temp
/test.log

/tests/k8s/_out/
replace_content.txt
10 changes: 6 additions & 4 deletions docs/src/user/basic_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ $ sudo dnf install \
Install from the GitHub release.
Note that this way also requires the aforementioned installation.

<!--youki release begin-->
```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
```
<!--youki release end-->

## Getting the source

Expand Down
21 changes: 21 additions & 0 deletions scripts/release_tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

TAG=${1:-0.3.1}

START_MARKER="<!--youki release begin-->"
END_MARKER="<!--youki release end-->"


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

0 comments on commit d65d383

Please sign in to comment.