mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-10 06:30:32 +00:00
Revert "Update release scripts (take 3)"
This reverts commit be8c41d56e.
```
+ git push origin refs/heads/v2
To https://github.com/taiki-e/install-action
! [rejected] v2 -> v2 (non-fast-forward)
error: failed to push some refs to 'https://github.com/taiki-e/install-action'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
```
This commit is contained in:
3
.github/workflows/release.yml
vendored
3
.github/workflows/release.yml
vendored
@@ -22,11 +22,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CREATE_PR_TOKEN }}
|
persist-credentials: false
|
||||||
- uses: taiki-e/create-gh-release-action@v1
|
- uses: taiki-e/create-gh-release-action@v1
|
||||||
with:
|
with:
|
||||||
changelog: CHANGELOG.md
|
changelog: CHANGELOG.md
|
||||||
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
|
|
||||||
|
|||||||
@@ -1,75 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
||||||
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-based
|
|
||||||
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
|
|
||||||
@@ -102,7 +102,53 @@ if [[ -n "${tags}" ]]; then
|
|||||||
x git commit -m "Release ${version}"
|
x git commit -m "Release ${version}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
x git tag "${tag}"
|
tools=()
|
||||||
# TODO: the following still assumes admin permissions
|
for tool in tools/codegen/base/*.json; do
|
||||||
x git push origin main
|
tools+=("$(basename "${tool%.*}")")
|
||||||
x git push origin --tags
|
done
|
||||||
|
# Aliases
|
||||||
|
tools+=(nextest)
|
||||||
|
# Not manifest-based
|
||||||
|
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