mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-21 15:10:27 +00:00
Compare commits
1 Commits
releases/p
...
release-gu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7379c13bb |
1
.github/workflows/release.yml
vendored
1
.github/workflows/release.yml
vendored
@@ -29,3 +29,4 @@ jobs:
|
|||||||
title: $version
|
title: $version
|
||||||
branch: 'main|v[0-9]+'
|
branch: 'main|v[0-9]+'
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- run: ci/publish.sh
|
||||||
|
|||||||
@@ -17,3 +17,31 @@ See JSON files in `tools/codegen/base` directory for examples of the manifest.
|
|||||||
3\. Add tool name to test matrix in `.github/workflows/ci.yml`.
|
3\. Add tool name to test matrix in `.github/workflows/ci.yml`.
|
||||||
|
|
||||||
4\. Add tool name to table in "Supported tools" section in `README.md`.
|
4\. Add tool name to table in "Supported tools" section in `README.md`.
|
||||||
|
|
||||||
|
## Release new version
|
||||||
|
|
||||||
|
Note: This is a guide for maintainers.
|
||||||
|
|
||||||
|
### Minor version vs patch version
|
||||||
|
|
||||||
|
Increase the patch version if only the following changes are included.
|
||||||
|
|
||||||
|
- Update the `@latest` version of the tool.
|
||||||
|
|
||||||
|
Rationale: Normally, tool versions are controlled by the `@<version>` syntax, which is explicitly separated from the versioning of the install-action itself.
|
||||||
|
|
||||||
|
Exception: If the major or minor version of the `cargo-binstall` is updated, the minor version should be increased because the behavior of the fallback may change slightly.
|
||||||
|
|
||||||
|
- Fix regressions or minor bugs.
|
||||||
|
|
||||||
|
Rationale: Semantic Versioning.
|
||||||
|
|
||||||
|
- Improve documentation or diagnostics.
|
||||||
|
|
||||||
|
Rationale: Semantic Versioning.
|
||||||
|
|
||||||
|
Increase the minor version otherwise.
|
||||||
|
|
||||||
|
### Release instructions
|
||||||
|
|
||||||
|
TODO: current release script assumes admin permissions
|
||||||
|
|||||||
@@ -3,6 +3,15 @@ set -euxo pipefail
|
|||||||
IFS=$'\n\t'
|
IFS=$'\n\t'
|
||||||
cd "$(dirname "$0")"/..
|
cd "$(dirname "$0")"/..
|
||||||
|
|
||||||
|
bail() {
|
||||||
|
echo >&2 "error: $*"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ -z "${CI:-}" ]]; then
|
||||||
|
bail "this script is intended to call from release workflow on CI"
|
||||||
|
fi
|
||||||
|
|
||||||
git config user.name "Taiki Endo"
|
git config user.name "Taiki Endo"
|
||||||
git config user.email "te316e89@gmail.com"
|
git config user.email "te316e89@gmail.com"
|
||||||
|
|
||||||
|
|||||||
74
ci/publish.sh
Executable file
74
ci/publish.sh
Executable file
@@ -0,0 +1,74 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
cd "$(dirname "$0")"/..
|
||||||
|
|
||||||
|
# shellcheck disable=SC2154
|
||||||
|
trap 's=$?; echo >&2 "$0: Error on line "${LINENO}": ${BASH_COMMAND}"; exit ${s}' ERR
|
||||||
|
|
||||||
|
bail() {
|
||||||
|
echo >&2 "error: $*"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ -z "${CI:-}" ]]; then
|
||||||
|
bail "this script is intended to call from release workflow on CI"
|
||||||
|
fi
|
||||||
|
ref="${GITHUB_REF:-}"
|
||||||
|
if [[ "${ref}" != "refs/tags/"* ]]; then
|
||||||
|
bail "tag ref should start with 'refs/tags/'"
|
||||||
|
fi
|
||||||
|
tag="${ref#refs/tags/}"
|
||||||
|
|
||||||
|
git config user.name "Taiki Endo"
|
||||||
|
git config user.email "te316e89@gmail.com"
|
||||||
|
|
||||||
|
version="${tag}"
|
||||||
|
version="${version#v}"
|
||||||
|
|
||||||
|
tools=()
|
||||||
|
for tool in tools/codegen/base/*.json; do
|
||||||
|
tools+=("$(basename "${tool%.*}")")
|
||||||
|
done
|
||||||
|
# Aliases
|
||||||
|
tools+=(nextest)
|
||||||
|
# Not manifest-base
|
||||||
|
tools+=(valgrind)
|
||||||
|
|
||||||
|
(
|
||||||
|
set -x
|
||||||
|
|
||||||
|
major_version_tag="v${version%%.*}"
|
||||||
|
git checkout -b "${major_version_tag}"
|
||||||
|
git push origin refs/heads/"${major_version_tag}"
|
||||||
|
if git --no-pager tag | grep -Eq "^${major_version_tag}$"; then
|
||||||
|
git tag -d "${major_version_tag}"
|
||||||
|
git push --delete origin refs/tags/"${major_version_tag}"
|
||||||
|
fi
|
||||||
|
git tag "${major_version_tag}"
|
||||||
|
git checkout main
|
||||||
|
git branch -d "${major_version_tag}"
|
||||||
|
)
|
||||||
|
|
||||||
|
for tool in "${tools[@]}"; do
|
||||||
|
(
|
||||||
|
set -x
|
||||||
|
git checkout -b "${tool}"
|
||||||
|
sed -i -e "s/required: true/required: false/g" action.yml
|
||||||
|
sed -i -e "s/# default: #publish:tool/default: ${tool}/g" action.yml
|
||||||
|
git add action.yml
|
||||||
|
git commit -m "${tool}"
|
||||||
|
git push origin -f refs/heads/"${tool}"
|
||||||
|
if git --no-pager tag | grep -Eq "^${tool}$"; then
|
||||||
|
git tag -d "${tool}"
|
||||||
|
git push --delete origin refs/tags/"${tool}"
|
||||||
|
fi
|
||||||
|
git tag "${tool}"
|
||||||
|
git checkout main
|
||||||
|
git branch -D "${tool}"
|
||||||
|
)
|
||||||
|
done
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
git push origin --tags
|
||||||
@@ -14,6 +14,14 @@ trap 's=$?; echo >&2 "$0: Error on line "${LINENO}": ${BASH_COMMAND}"; exit ${s}
|
|||||||
# Note: This script requires the following tools:
|
# Note: This script requires the following tools:
|
||||||
# - parse-changelog <https://github.com/taiki-e/parse-changelog>
|
# - parse-changelog <https://github.com/taiki-e/parse-changelog>
|
||||||
|
|
||||||
|
x() {
|
||||||
|
local cmd="$1"
|
||||||
|
shift
|
||||||
|
(
|
||||||
|
set -x
|
||||||
|
"${cmd}" "$@"
|
||||||
|
)
|
||||||
|
}
|
||||||
bail() {
|
bail() {
|
||||||
echo >&2 "error: $*"
|
echo >&2 "error: $*"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -40,6 +48,7 @@ if gh release view "${tag}" &>/dev/null; then
|
|||||||
bail "tag '${tag}' has already been created and pushed"
|
bail "tag '${tag}' has already been created and pushed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Make sure that the release was created from an allowed branch.
|
||||||
if ! git branch | grep -q '\* main$'; then
|
if ! git branch | grep -q '\* main$'; then
|
||||||
bail "current branch is not 'main'"
|
bail "current branch is not 'main'"
|
||||||
fi
|
fi
|
||||||
@@ -88,57 +97,11 @@ echo "======================================="
|
|||||||
|
|
||||||
if [[ -n "${tags}" ]]; then
|
if [[ -n "${tags}" ]]; then
|
||||||
# Create a release commit.
|
# Create a release commit.
|
||||||
git add "${changelog}"
|
x git add "${changelog}"
|
||||||
git commit -m "Release ${version}"
|
x git commit -m "Release ${version}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tools=()
|
x git tag "${tag}"
|
||||||
for tool in tools/codegen/base/*.json; do
|
# TODO: the following still assumes admin permissions
|
||||||
tools+=("$(basename "${tool%.*}")")
|
x git push origin main
|
||||||
done
|
x git push origin --tags
|
||||||
# Aliases
|
|
||||||
tools+=(nextest)
|
|
||||||
# Not manifest-base
|
|
||||||
tools+=(valgrind)
|
|
||||||
|
|
||||||
(
|
|
||||||
set -x
|
|
||||||
|
|
||||||
git tag "${tag}"
|
|
||||||
git push origin main
|
|
||||||
git push origin --tags
|
|
||||||
|
|
||||||
major_version_tag="v${version%%.*}"
|
|
||||||
git checkout -b "${major_version_tag}"
|
|
||||||
git push origin refs/heads/"${major_version_tag}"
|
|
||||||
if git --no-pager tag | grep -Eq "^${major_version_tag}$"; then
|
|
||||||
git tag -d "${major_version_tag}"
|
|
||||||
git push --delete origin refs/tags/"${major_version_tag}"
|
|
||||||
fi
|
|
||||||
git tag "${major_version_tag}"
|
|
||||||
git checkout main
|
|
||||||
git branch -d "${major_version_tag}"
|
|
||||||
)
|
|
||||||
|
|
||||||
for tool in "${tools[@]}"; do
|
|
||||||
(
|
|
||||||
set -x
|
|
||||||
git checkout -b "${tool}"
|
|
||||||
sed -i -e "s/required: true/required: false/g" action.yml
|
|
||||||
sed -i -e "s/# default: #publish:tool/default: ${tool}/g" action.yml
|
|
||||||
git add action.yml
|
|
||||||
git commit -m "${tool}"
|
|
||||||
git push origin -f refs/heads/"${tool}"
|
|
||||||
if git --no-pager tag | grep -Eq "^${tool}$"; then
|
|
||||||
git tag -d "${tool}"
|
|
||||||
git push --delete origin refs/tags/"${tool}"
|
|
||||||
fi
|
|
||||||
git tag "${tool}"
|
|
||||||
git checkout main
|
|
||||||
git branch -D "${tool}"
|
|
||||||
)
|
|
||||||
done
|
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
git push origin --tags
|
|
||||||
|
|||||||
Reference in New Issue
Block a user