mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-05 20:50:27 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
decc7be9bf | ||
|
|
01ea03f457 | ||
|
|
de870dd7b6 |
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@@ -24,10 +24,11 @@ jobs:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-18.04
|
||||
- ubuntu-20.04
|
||||
tool:
|
||||
# Note: Specifying the version of valgrind and wasm-pack is not supported.
|
||||
- cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,shellcheck,shfmt,valgrind,wasm-pack,wasmtime
|
||||
- cargo-hack@0.5.12,cargo-llvm-cov@0.2.0,cargo-minimal-versions@0.1.3,parse-changelog@0.4.7,cross@0.2.1,shellcheck@0.8.0,shfmt@3.4.2,wasmtime@0.34.0
|
||||
- cargo-hack@0.5.12,cargo-llvm-cov@0.2.2,cargo-minimal-versions@0.1.3,parse-changelog@0.4.7,cross@0.2.1,shellcheck@0.8.0,shfmt@3.4.3,wasmtime@0.34.0
|
||||
include:
|
||||
- os: macos-10.15
|
||||
tool: cargo-hack,cargo-llvm-cov,cargo-minimal-versions,parse-changelog,cross,shellcheck,shfmt,wasm-pack,wasmtime
|
||||
|
||||
@@ -10,6 +10,10 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.1.7] - 2022-03-02
|
||||
|
||||
- Update `cargo-llvm-cov@latest` to 0.2.2.
|
||||
|
||||
## [1.1.6] - 2022-02-20
|
||||
|
||||
- Update `cargo-llvm-cov@latest` to 0.2.1.
|
||||
@@ -58,7 +62,8 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
||||
|
||||
Initial release
|
||||
|
||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v1.1.6...HEAD
|
||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v1.1.7...HEAD
|
||||
[1.1.7]: https://github.com/taiki-e/install-action/compare/v1.1.6...v1.1.7
|
||||
[1.1.6]: https://github.com/taiki-e/install-action/compare/v1.1.5...v1.1.6
|
||||
[1.1.5]: https://github.com/taiki-e/install-action/compare/v1.1.4...v1.1.5
|
||||
[1.1.4]: https://github.com/taiki-e/install-action/compare/v1.1.3...v1.1.4
|
||||
|
||||
8
main.sh
8
main.sh
@@ -59,7 +59,7 @@ for tool in "${tools[@]}"; do
|
||||
# https://github.com/taiki-e/cargo-hack/releases
|
||||
cargo-hack) latest_version="0.5.12" ;;
|
||||
# https://github.com/taiki-e/cargo-llvm-cov/releases
|
||||
cargo-llvm-cov) latest_version="0.2.1" ;;
|
||||
cargo-llvm-cov) latest_version="0.2.2" ;;
|
||||
# https://github.com/taiki-e/cargo-minimal-versions/releases
|
||||
cargo-minimal-versions) latest_version="0.1.3" ;;
|
||||
# https://github.com/taiki-e/parse-changelog/releases
|
||||
@@ -146,12 +146,12 @@ for tool in "${tools[@]}"; do
|
||||
latest) ;;
|
||||
*) warn "specifying the version of ${tool} is not supported yet by this action" ;;
|
||||
esac
|
||||
sudo apt-get -o Acquire::Retries=10 -qq update
|
||||
retry sudo apt-get -o Acquire::Retries=10 -qq update
|
||||
# libc6-dbg is needed to run Valgrind
|
||||
sudo apt-get -o Acquire::Retries=10 -qq -o Dpkg::Use-Pty=0 install -y libc6-dbg
|
||||
retry sudo apt-get -o Acquire::Retries=10 -qq -o Dpkg::Use-Pty=0 install -y libc6-dbg
|
||||
# Use snap to install the latest Valgrind
|
||||
# https://snapcraft.io/install/valgrind/ubuntu
|
||||
sudo snap install valgrind --classic
|
||||
retry sudo snap install valgrind --classic
|
||||
;;
|
||||
wasm-pack)
|
||||
# https://rustwasm.github.io/wasm-pack/installer
|
||||
|
||||
@@ -31,30 +31,33 @@ git diff --exit-code
|
||||
git diff --exit-code --staged
|
||||
|
||||
# Make sure the same release has not been created in the past.
|
||||
if gh release view "${tag}" >/dev/null; then
|
||||
if gh release view "${tag}" &>/dev/null; then
|
||||
bail "tag '${tag}' has already been created and pushed"
|
||||
fi
|
||||
|
||||
# Make sure the same release does not exist in CHANGELOG.md.
|
||||
release_date=$(date --utc '+%Y-%m-%d')
|
||||
if grep -Eq "^## \\[${version//./\\.}\\] - ${release_date}$" CHANGELOG.md; then
|
||||
bail "release ${version} already exist in CHANGELOG.md"
|
||||
fi
|
||||
if grep -Eq "^\\[${version//./\\.}\\]: " CHANGELOG.md; then
|
||||
bail "link to ${version} already exist in CHANGELOG.md"
|
||||
fi
|
||||
tags=$(git --no-pager tag)
|
||||
if [[ -n "${tags}" ]]; then
|
||||
# Make sure the same release does not exist in CHANGELOG.md.
|
||||
release_date=$(date --utc '+%Y-%m-%d')
|
||||
if grep -Eq "^## \\[${version//./\\.}\\] - ${release_date}$" CHANGELOG.md; then
|
||||
bail "release ${version} already exist in CHANGELOG.md"
|
||||
fi
|
||||
if grep -Eq "^\\[${version//./\\.}\\]: " CHANGELOG.md; then
|
||||
bail "link to ${version} already exist in CHANGELOG.md"
|
||||
fi
|
||||
|
||||
# Update changelog.
|
||||
remote_url=$(grep -E '^\[Unreleased\]: https://' CHANGELOG.md | sed 's/^\[Unreleased\]: //' | sed 's/\.\.\.HEAD$//')
|
||||
before_tag=$(sed <<<"${remote_url}" 's/^.*\/compare\///')
|
||||
remote_url=$(sed <<<"${remote_url}" 's/\/compare\/v.*$//')
|
||||
sed -i "s/^## \\[Unreleased\\]/## [Unreleased]\\n\\n## [${version}] - ${release_date}/" CHANGELOG.md
|
||||
sed -i "s#^\[Unreleased\]: https://.*#[Unreleased]: ${remote_url}/compare/v${version}...HEAD\\n[${version}]: ${remote_url}/compare/${before_tag}...v${version}#" CHANGELOG.md
|
||||
if ! grep -Eq "^## \\[${version//./\\.}\\] - ${release_date}$" CHANGELOG.md; then
|
||||
bail "failed to update CHANGELOG.md"
|
||||
fi
|
||||
if ! grep -Eq "^\\[${version//./\\.}\\]: " CHANGELOG.md; then
|
||||
bail "failed to update CHANGELOG.md"
|
||||
# Update changelog.
|
||||
remote_url=$(grep -E '^\[Unreleased\]: https://' CHANGELOG.md | sed 's/^\[Unreleased\]: //' | sed 's/\.\.\.HEAD$//')
|
||||
before_tag=$(sed <<<"${remote_url}" 's/^.*\/compare\///')
|
||||
remote_url=$(sed <<<"${remote_url}" 's/\/compare\/v.*$//')
|
||||
sed -i "s/^## \\[Unreleased\\]/## [Unreleased]\\n\\n## [${version}] - ${release_date}/" CHANGELOG.md
|
||||
sed -i "s#^\[Unreleased\]: https://.*#[Unreleased]: ${remote_url}/compare/v${version}...HEAD\\n[${version}]: ${remote_url}/compare/${before_tag}...v${version}#" CHANGELOG.md
|
||||
if ! grep -Eq "^## \\[${version//./\\.}\\] - ${release_date}$" CHANGELOG.md; then
|
||||
bail "failed to update CHANGELOG.md"
|
||||
fi
|
||||
if ! grep -Eq "^\\[${version//./\\.}\\]: " CHANGELOG.md; then
|
||||
bail "failed to update CHANGELOG.md"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Make sure that a valid release note for this version exists.
|
||||
@@ -63,9 +66,11 @@ echo "============== CHANGELOG =============="
|
||||
parse-changelog CHANGELOG.md "${version}"
|
||||
echo "======================================="
|
||||
|
||||
# Create a release commit.
|
||||
git add CHANGELOG.md
|
||||
git commit -m "Release ${version}"
|
||||
if [[ -n "${tags}" ]]; then
|
||||
# Create a release commit.
|
||||
git add CHANGELOG.md
|
||||
git commit -m "Release ${version}"
|
||||
fi
|
||||
|
||||
tools=(
|
||||
cargo-hack
|
||||
|
||||
Reference in New Issue
Block a user