mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
ci: update version in docs & sec pol on release (#1293)
This commit is contained in:
parent
5733bc2fc4
commit
ce16c638b7
24
.github/workflows/docs-version.yml
vendored
24
.github/workflows/docs-version.yml
vendored
@ -1,24 +0,0 @@
|
||||
name: "Docs Version Update"
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
bump-version-in-docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
name: checkout repo
|
||||
with:
|
||||
ref: "refs/heads/master"
|
||||
|
||||
- run: sed -i "s|^\\(git clone.*--branch \\).*$|\\1v$(cat version.txt)|" docs/guide/getting-started.md
|
||||
name: replace version in docs
|
||||
|
||||
- uses: stefanzweifel/git-auto-commit-action@v4
|
||||
name: commit docs version update
|
||||
with:
|
||||
commit_message: "docs: update version in install instructions"
|
23
.github/workflows/on-release.yml
vendored
Normal file
23
.github/workflows/on-release.yml
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
name: On Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
bump-versions-in-docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: "refs/heads/master"
|
||||
- name: replace version in getting-started docs
|
||||
run: scripts/update_version_in_docs.bash
|
||||
- name: replace version in security policy support list
|
||||
run: scripts/update_version_list_in_security_policy.bash
|
||||
- name: commit docs version update
|
||||
uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: "docs: update version in install instructions & security policy"
|
3
.github/workflows/tests.yml
vendored
3
.github/workflows/tests.yml
vendored
@ -7,7 +7,6 @@ on:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
BATS_VERSION: v1.7.0
|
||||
ELVISH_VERSION: v0.18.0
|
||||
|
||||
jobs:
|
||||
@ -50,7 +49,7 @@ jobs:
|
||||
|
||||
- name: Install bats
|
||||
run: |
|
||||
git clone --depth 1 --branch "${{ env.BATS_VERSION }}" https://github.com/bats-core/bats-core.git $HOME/bats-core
|
||||
git clone --depth 1 --branch "v$(grep -Eo "^\\s*bats\\s*.*$" ".tool-versions" | cut -d ' ' -f2-)" https://github.com/bats-core/bats-core.git $HOME/bats-core
|
||||
echo "$HOME/bats-core/bin" >>"$GITHUB_PATH"
|
||||
|
||||
- name: Run tests
|
||||
|
@ -1,5 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
exec shellcheck -s bash -x \
|
||||
asdf.sh \
|
||||
completions/*.bash \
|
||||
|
@ -1,3 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
exec shfmt -d .
|
||||
|
6
scripts/update_version_in_docs.bash
Executable file
6
scripts/update_version_in_docs.bash
Executable file
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
version=$(cat version.txt)
|
||||
sed -i "s/\\(git clone.*--branch \\).*\\(\`.*|\\)/\\1v$version\\2/" docs/guide/getting-started.md
|
12
scripts/update_version_list_in_security_policy.bash
Executable file
12
scripts/update_version_list_in_security_policy.bash
Executable file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
version_major_minor_x="$(cut -f1-2 -d "." version.txt).x"
|
||||
|
||||
# skip if version is already in the list
|
||||
if ! grep -q "$version_major_minor_x" SECURITY.md; then
|
||||
# prepend new version to the list
|
||||
sed -i "s/white_check_mark:/x: /g" SECURITY.md
|
||||
sed -i "s/^\\(| -* | -* |\\)$/\\1\\n| $version_major_minor_x | :white_check_mark: |/" SECURITY.md
|
||||
fi
|
Loading…
Reference in New Issue
Block a user