mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-02 03:10:28 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4efcb9aabf | ||
|
|
be8c41d56e | ||
|
|
76d33aa44e | ||
|
|
143626c55b | ||
|
|
5251e6a3db | ||
|
|
d8aee37aa8 | ||
|
|
a08c2af7ad | ||
|
|
648287cffe | ||
|
|
a2d6b56270 |
3
.github/.cspell/organization-dictionary.txt
vendored
3
.github/.cspell/organization-dictionary.txt
vendored
@@ -115,6 +115,7 @@ nonoverlapping
|
||||
noreturn
|
||||
nostack
|
||||
peekable
|
||||
powf
|
||||
punct
|
||||
rclass
|
||||
repr
|
||||
@@ -164,7 +165,5 @@ readelf
|
||||
shellcheckrc
|
||||
SIGABRT
|
||||
SIGILL
|
||||
SIGINT
|
||||
SIGTERM
|
||||
subcmd
|
||||
tlsv
|
||||
|
||||
3
.github/workflows/release.yml
vendored
3
.github/workflows/release.yml
vendored
@@ -22,10 +22,11 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
token: ${{ secrets.CREATE_PR_TOKEN }}
|
||||
- uses: taiki-e/create-gh-release-action@v1
|
||||
with:
|
||||
changelog: CHANGELOG.md
|
||||
title: $version
|
||||
branch: 'main|v[0-9]+'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- run: ci/publish.sh
|
||||
|
||||
17
CHANGELOG.md
17
CHANGELOG.md
@@ -10,6 +10,18 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [2.12.10] - 2023-07-09
|
||||
|
||||
- Update `dprint@latest` to 0.39.0.
|
||||
|
||||
## [2.12.9] - 2023-07-08
|
||||
|
||||
- Update `cargo-llvm-cov@latest` to 0.5.23.
|
||||
|
||||
## [2.12.8] - 2023-07-07
|
||||
|
||||
- Update `protoc@latest` to 3.23.4.
|
||||
|
||||
## [2.12.7] - 2023-07-04
|
||||
|
||||
- Update `parse-changelog@latest` to 0.6.1.
|
||||
@@ -923,7 +935,10 @@ Note: This release is considered a breaking change because installing on version
|
||||
|
||||
Initial release
|
||||
|
||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.12.7...HEAD
|
||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.12.10...HEAD
|
||||
[2.12.10]: https://github.com/taiki-e/install-action/compare/v2.12.9...v2.12.10
|
||||
[2.12.9]: https://github.com/taiki-e/install-action/compare/v2.12.8...v2.12.9
|
||||
[2.12.8]: https://github.com/taiki-e/install-action/compare/v2.12.7...v2.12.8
|
||||
[2.12.7]: https://github.com/taiki-e/install-action/compare/v2.12.6...v2.12.7
|
||||
[2.12.6]: https://github.com/taiki-e/install-action/compare/v2.12.5...v2.12.6
|
||||
[2.12.5]: https://github.com/taiki-e/install-action/compare/v2.12.4...v2.12.5
|
||||
|
||||
@@ -4,6 +4,15 @@ set -euxo pipefail
|
||||
IFS=$'\n\t'
|
||||
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.email "te316e89@gmail.com"
|
||||
|
||||
|
||||
75
ci/publish.sh
Executable file
75
ci/publish.sh
Executable file
@@ -0,0 +1,75 @@
|
||||
#!/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
|
||||
21
manifests/cargo-llvm-cov.json
generated
21
manifests/cargo-llvm-cov.json
generated
@@ -17,10 +17,27 @@
|
||||
}
|
||||
},
|
||||
"latest": {
|
||||
"version": "0.5.22"
|
||||
"version": "0.5.23"
|
||||
},
|
||||
"0.5": {
|
||||
"version": "0.5.22"
|
||||
"version": "0.5.23"
|
||||
},
|
||||
"0.5.23": {
|
||||
"x86_64_linux_musl": {
|
||||
"checksum": "cdbb1c34bffeb2b5b986f16e3e1dd08c01d9ef2cbd1cf2d989ae7a184ce91302"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"checksum": "e87ffd34514d23b5ce5d70e62eaff51c8a56308fcfea5d2df1cbf7a4930883af"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"checksum": "3b0885d80a5d33c687331628adca4307cfb5d80a3d76a344ebf1077e504da08e"
|
||||
},
|
||||
"aarch64_linux_musl": {
|
||||
"checksum": "5ad1d9b56601b76112c2555289763b88e0aba57b5188c7cb0b7e0c9f17141590"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"checksum": "bfc30b8d89cf3b477caa8b4eee89bc083d8a3649e57a88eaa7a3a4948e5eaa0e"
|
||||
}
|
||||
},
|
||||
"0.5.22": {
|
||||
"x86_64_linux_musl": {
|
||||
|
||||
22
manifests/dprint.json
generated
22
manifests/dprint.json
generated
@@ -20,7 +20,27 @@
|
||||
}
|
||||
},
|
||||
"latest": {
|
||||
"version": "0.38.3"
|
||||
"version": "0.39.0"
|
||||
},
|
||||
"0.39": {
|
||||
"version": "0.39.0"
|
||||
},
|
||||
"0.39.0": {
|
||||
"x86_64_linux_musl": {
|
||||
"checksum": "85a05abe62b607b0b632dc2dfb70f1f0c25d0ba1c917ec5c57e4aba226617d42"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"checksum": "79d1bbe2f811ddd4f9da83cb827abccc2a2fa851709886c8df9e1dd264d348a6"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"checksum": "6e7726628ae1a656e9a889926c49b0d0dc213867e310112e550579512bedac40"
|
||||
},
|
||||
"aarch64_linux_gnu": {
|
||||
"checksum": "d638ef063d33e12e4ee6ebb501655179c2be2a25800e6e8fa53c8d4413f08df4"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"checksum": "78a17f1697e12b370c5c8f49665ff81bc97407c54f77d3f6ceae226c323a1c58"
|
||||
}
|
||||
},
|
||||
"0.38": {
|
||||
"version": "0.38.3"
|
||||
|
||||
28
manifests/protoc.json
generated
28
manifests/protoc.json
generated
@@ -1,13 +1,35 @@
|
||||
{
|
||||
"template": null,
|
||||
"latest": {
|
||||
"version": "3.23.3"
|
||||
"version": "3.23.4"
|
||||
},
|
||||
"3": {
|
||||
"version": "3.23.3"
|
||||
"version": "3.23.4"
|
||||
},
|
||||
"3.23": {
|
||||
"version": "3.23.3"
|
||||
"version": "3.23.4"
|
||||
},
|
||||
"3.23.4": {
|
||||
"x86_64_linux_gnu": {
|
||||
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protoc-23.4-linux-x86_64.zip",
|
||||
"checksum": "0502f286ac9ed860b629a7965a14527b1f2dd131e4283fa23c2d7f184672aa9a"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protoc-23.4-osx-x86_64.zip",
|
||||
"checksum": "07e5fdcf1b0708d3367dc5e6eb8d135de7e407d75316c93155cfd8ab362eec80"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protoc-23.4-win64.zip",
|
||||
"checksum": "a309c39442fb75f0db343cb22c111a00f91cdf0767f332e170644b9378e2bcc6"
|
||||
},
|
||||
"aarch64_linux_gnu": {
|
||||
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protoc-23.4-linux-aarch_64.zip",
|
||||
"checksum": "1c7750b6e038305b5a7fc3d0cda1ebefdf106a4f30a787bf826ed2fc47c3967d"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protoc-23.4-osx-aarch_64.zip",
|
||||
"checksum": "8c7afae8626b6811e7b5897d16d940c2dbf50b1e135ed958a01db6566bdda726"
|
||||
}
|
||||
},
|
||||
"3.23.3": {
|
||||
"x86_64_linux_gnu": {
|
||||
|
||||
@@ -399,29 +399,20 @@ fn replace_vars(s: &str, package: &str, version: &str, platform: HostPlatform) -
|
||||
}
|
||||
|
||||
fn download(url: &str) -> Result<ureq::Response> {
|
||||
let mut token1 = env::var("INTERNAL_CODEGEN_GH_PAT")
|
||||
.ok()
|
||||
.filter(|v| !v.is_empty());
|
||||
let mut token2 = env::var("GITHUB_TOKEN").ok().filter(|v| !v.is_empty());
|
||||
let mut token = env::var("GITHUB_TOKEN").ok().filter(|v| !v.is_empty());
|
||||
let mut retry = 0;
|
||||
let mut last_error;
|
||||
loop {
|
||||
let mut req = ureq::get(url);
|
||||
if let Some(token) = &token1 {
|
||||
req = req.set("Authorization", token);
|
||||
} else if let Some(token) = &token2 {
|
||||
if let Some(token) = &token {
|
||||
req = req.set("Authorization", token);
|
||||
}
|
||||
match req.call() {
|
||||
Ok(res) => return Ok(res),
|
||||
Err(e) => last_error = Some(e),
|
||||
}
|
||||
if retry == 3 || retry == 6 {
|
||||
if token1.is_some() {
|
||||
token1 = None;
|
||||
} else if token2.is_some() {
|
||||
token2 = None;
|
||||
}
|
||||
if retry == 5 && token.is_some() {
|
||||
token = None;
|
||||
}
|
||||
retry += 1;
|
||||
if retry > 10 {
|
||||
|
||||
@@ -15,6 +15,14 @@ trap 's=$?; echo >&2 "$0: error on line "${LINENO}": ${BASH_COMMAND}"; exit ${s}
|
||||
# Note: This script requires the following tools:
|
||||
# - parse-changelog <https://github.com/taiki-e/parse-changelog>
|
||||
|
||||
x() {
|
||||
local cmd="$1"
|
||||
shift
|
||||
(
|
||||
set -x
|
||||
"${cmd}" "$@"
|
||||
)
|
||||
}
|
||||
bail() {
|
||||
echo >&2 "error: $*"
|
||||
exit 1
|
||||
@@ -41,6 +49,7 @@ if gh release view "${tag}" &>/dev/null; then
|
||||
bail "tag '${tag}' has already been created and pushed"
|
||||
fi
|
||||
|
||||
# Make sure that the release was created from an allowed branch.
|
||||
if ! git branch | grep -q '\* main$'; then
|
||||
bail "current branch is not 'main'"
|
||||
fi
|
||||
@@ -89,57 +98,11 @@ echo "======================================="
|
||||
|
||||
if [[ -n "${tags}" ]]; then
|
||||
# Create a release commit.
|
||||
git add "${changelog}"
|
||||
git commit -m "Release ${version}"
|
||||
x git add "${changelog}"
|
||||
x git commit -m "Release ${version}"
|
||||
fi
|
||||
|
||||
tools=()
|
||||
for tool in tools/codegen/base/*.json; do
|
||||
tools+=("$(basename "${tool%.*}")")
|
||||
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
|
||||
x git tag "${tag}"
|
||||
# TODO: the following still assumes admin permissions
|
||||
x git push origin main
|
||||
x git push origin --tags
|
||||
|
||||
Reference in New Issue
Block a user