Bump #4296
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Bump | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "50 1-23/8 * * *" | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- "**/LICENSE" | |
- "**/README.md" | |
pull_request: | |
branches: | |
- master | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "Bump" | |
Bump: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set some variables | |
run: | | |
set -x | |
GITHUB_API_BASEURL='https://api.github.com' | |
TMP_FILE=$(mktemp) | |
if curl -sS -i -I -H "Accept: application/vnd.github.v3+json" -o "$TMP_FILE" -- 'https://github-cache.yingmale.win/api/'; then | |
HTTP_STATUS_CODE=$(awk 'NR==1 {print $2}' "$TMP_FILE") | |
if [[ $HTTP_STATUS_CODE -ge 200 ]] && [[ $HTTP_STATUS_CODE -le 299 ]]; then | |
GITHUB_API_BASEURL='https://github-cache.yingmale.win/api' | |
echo "info: github cache is ready, will use ${GITHUB_API_BASEURL} as GITHUB_API_BASEURL." | |
fi | |
fi | |
"rm" -f "$TMP_FILE" | |
echo "GITHUB_API_BASEURL=${GITHUB_API_BASEURL}" >> $GITHUB_ENV | |
echo "RELEASE_NAME=$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV | |
echo "checksec_latest_tag_name=$(curl -sSL --fail --retry 5 --retry-delay 10 --retry-max-time 60 -H 'Accept: application/vnd.github.v3+json' \ | |
"${GITHUB_API_BASEURL}/repos/slimm609/checksec.sh/releases/latest" | | |
grep -F 'tag_name' | cut -d'"' -f4)" >> $GITHUB_ENV | |
echo "bashrc_latest_commit_hash=$(curl -sSL --fail --retry 5 --retry-delay 10 --retry-max-time 60 -H 'Accept: application/vnd.github.v3+json' \ | |
"${GITHUB_API_BASEURL}/repos/IceCodeNew/myrc/commits?per_page=1&path=.bashrc" | | |
grep -Fm1 'sha' | cut -d'"' -f4)" >> $GITHUB_ENV | |
echo "mold_latest_tag_name=$(curl -sSL --fail --retry 5 --retry-delay 10 --retry-max-time 60 -H 'Accept: application/vnd.github.v3+json' \ | |
"${GITHUB_API_BASEURL}/repos/rui314/mold/releases/latest" | | |
grep -F 'tag_name' | cut -d'"' -f4)" >> $GITHUB_ENV | |
echo "zlib_ng_latest_tag_name=$(curl -sSL --fail --retry 5 --retry-delay 10 --retry-max-time 60 -H 'Accept: application/vnd.github.v3+json' \ | |
"${GITHUB_API_BASEURL}/repos/zlib-ng/zlib-ng/releases/latest" | | |
grep -F 'tag_name' | cut -d'"' -f4 | sed -E 's/^v//')" >> $GITHUB_ENV | |
echo "openssl_latest_tag_name=$(curl -sSL \ | |
'https://raw.githubusercontent.com/openssl/openssl/OpenSSL_1_1_1-stable/README' | | |
grep -Eo '1.1.1.*')" >> $GITHUB_ENV | |
echo "openssl_latest_commit_hash=$(curl -sSL --fail --retry 5 --retry-delay 10 --retry-max-time 60 -H 'Accept: application/vnd.github.v3+json' \ | |
"${GITHUB_API_BASEURL}/repos/openssl/openssl/commits?per_page=1&sha=OpenSSL_1_1_1-stable" | | |
grep -Fm1 'sha' | cut -d'"' -f4)" >> $GITHUB_ENV | |
echo "cmake_latest_tag_name=$(curl -sSL --fail --retry 5 --retry-delay 10 --retry-max-time 60 -H 'Accept: application/vnd.github.v3+json' \ | |
"${GITHUB_API_BASEURL}/repos/Kitware/CMake/tags?per_page=100" | | |
grep -F 'name' | cut -d'"' -f4 | grep -vE 'alpha|beta|rc|test|week' | | |
sort -Vr | head -n 1)" >> $GITHUB_ENV | |
echo "ninja_latest_tag_name=$(curl -sSL --fail --retry 5 --retry-delay 10 --retry-max-time 60 -H 'Accept: application/vnd.github.v3+json' \ | |
"${GITHUB_API_BASEURL}/repos/ninja-build/ninja/releases/latest" | | |
grep -F 'tag_name' | cut -d'"' -f4)" >> $GITHUB_ENV | |
echo "meson_latest_tag_name=$(curl -sSL --fail --retry 5 --retry-delay 10 --retry-max-time 60 -H 'Accept: application/vnd.github.v3+json' \ | |
"${GITHUB_API_BASEURL}/repos/mesonbuild/meson/releases/latest" | | |
grep -F 'tag_name' | cut -d'"' -f4)" >> $GITHUB_ENV | |
echo "netbsd_curses_tag_name=$(curl -sSL --fail --retry 5 --retry-delay 10 --retry-max-time 60 -H 'Accept: application/vnd.github.v3+json' \ | |
"${GITHUB_API_BASEURL}/repos/sabotage-linux/netbsd-curses/releases/latest" | | |
grep -F 'tag_name' | cut -d'"' -f4 | sed -E 's/^v//')" >> $GITHUB_ENV | |
echo "gettext_tiny_tag_name=$(curl -sSL --fail --retry 5 --retry-delay 10 --retry-max-time 60 -H 'Accept: application/vnd.github.v3+json' \ | |
"${GITHUB_API_BASEURL}/repos/sabotage-linux/gettext-tiny/releases/latest" | | |
grep -F 'tag_name' | cut -d'"' -f4 | sed -E 's/^v//')" >> $GITHUB_ENV | |
echo "parallel_version=$(curl -sSL \ | |
"https://ftpmirror.gnu.org/parallel/" | tr -d '\r\n\t' | | |
grep -Po '(?<=parallel-)[0-9]+(?=\.tar\.bz2)' | sort -Vr | head -n 1)" >> $GITHUB_ENV | |
echo "pcre2_version=$(curl -sSL --fail --retry 5 --retry-delay 10 --retry-max-time 60 -H 'Accept: application/vnd.github.v3+json' \ | |
"${GITHUB_API_BASEURL}/repos/PhilipHazel/pcre2/releases/latest" | | |
grep -F 'tag_name' | cut -d'"' -f4 | sed -E 's/^v//')" >> $GITHUB_ENV | |
echo "image_build_date=$(TZ=':Asia/Taipei' date +%F)" >> $GITHUB_ENV | |
set +x | |
shell: bash | |
# Runs a set of commands using the runners shell | |
- name: Force push `release` branch | |
run: | | |
git config --local user.name "actions" | |
git config --local user.email "action@github.com" | |
git checkout release | |
git reset --hard origin/master | |
sed -i -E "s/^ARG checksec_latest_tag_name=.+/ARG checksec_latest_tag_name=${checksec_latest_tag_name:?empty value}/" alpine_builder.Dockerfile ubuntu_builder.Dockerfile debian_oldstable_builder.Dockerfile debian_builder.Dockerfile | |
sed -i -E "s/^ARG bashrc_latest_commit_hash=.+/ARG bashrc_latest_commit_hash=${bashrc_latest_commit_hash:?empty value}/" alpine_builder.Dockerfile ubuntu_builder.Dockerfile debian_oldstable_builder.Dockerfile debian_builder.Dockerfile | |
sed -i -E "s/^ARG mold_latest_tag_name=.+/ARG mold_latest_tag_name=${mold_latest_tag_name:?empty value}/" alpine_builder.Dockerfile ubuntu_builder.Dockerfile debian_oldstable_builder.Dockerfile debian_builder.Dockerfile modern_toolbox_fedora.Dockerfile | |
sed -i -E "s/^ARG parallel_version=.+/ARG parallel_version=${parallel_version:?empty value}/" alpine_builder.Dockerfile ubuntu_builder.Dockerfile debian_oldstable_builder.Dockerfile debian_builder.Dockerfile | |
sed -i -E "s/^ARG pcre2_version=.+/ARG pcre2_version=${pcre2_version:?empty value}/" alpine_builder.Dockerfile ubuntu_builder.Dockerfile debian_oldstable_builder.Dockerfile debian_builder.Dockerfile | |
sed -i -E "s/^ARG zlib_ng_latest_tag_name=.+/ARG zlib_ng_latest_tag_name=${zlib_ng_latest_tag_name:?empty value}/" ubuntu_builder.Dockerfile debian_oldstable_builder.Dockerfile debian_builder.Dockerfile modern_toolbox_fedora.Dockerfile | |
sed -i -E "s/^ARG openssl_latest_tag_name=.+/ARG openssl_latest_tag_name=${openssl_latest_tag_name:?empty value}/" alpine_builder.Dockerfile ubuntu_builder.Dockerfile debian_oldstable_builder.Dockerfile debian_builder.Dockerfile modern_toolbox_fedora.Dockerfile | |
sed -i -E "s/^ARG openssl_latest_commit_hash=.+/ARG openssl_latest_commit_hash=${openssl_latest_commit_hash:?empty value}/" alpine_builder.Dockerfile ubuntu_builder.Dockerfile debian_oldstable_builder.Dockerfile debian_builder.Dockerfile modern_toolbox_fedora.Dockerfile | |
sed -i -E "s/^ARG cmake_latest_tag_name=.+/ARG cmake_latest_tag_name=${cmake_latest_tag_name:?empty value}/" alpine_builder.Dockerfile ubuntu_builder.Dockerfile debian_oldstable_builder.Dockerfile debian_builder.Dockerfile | |
sed -i -E "s/^ARG ninja_latest_tag_name=.+/ARG ninja_latest_tag_name=${ninja_latest_tag_name:?empty value}/" alpine_builder.Dockerfile ubuntu_builder.Dockerfile debian_oldstable_builder.Dockerfile debian_builder.Dockerfile | |
sed -i -E "s/^ARG meson_latest_tag_name=.+/ARG meson_latest_tag_name=${meson_latest_tag_name:?empty value}/" alpine_builder.Dockerfile ubuntu_builder.Dockerfile debian_oldstable_builder.Dockerfile debian_builder.Dockerfile | |
sed -i -E "s/^ARG netbsd_curses_tag_name=.+/ARG netbsd_curses_tag_name=${netbsd_curses_tag_name:?empty value}/" alpine_builder.Dockerfile ubuntu_builder.Dockerfile debian_oldstable_builder.Dockerfile debian_builder.Dockerfile | |
sed -i -E "s/^ARG gettext_tiny_tag_name=.+/ARG gettext_tiny_tag_name=${gettext_tiny_tag_name:?empty value}/" alpine_builder.Dockerfile ubuntu_builder.Dockerfile debian_oldstable_builder.Dockerfile debian_builder.Dockerfile | |
sed -i -E "s/^ARG image_build_date=.+/ARG image_build_date=${image_build_date:?empty value}/" alpine_builder.Dockerfile ubuntu_builder.Dockerfile debian_oldstable_builder.Dockerfile debian_builder.Dockerfile modern_toolbox_fedora.Dockerfile | |
git add alpine_builder.Dockerfile ubuntu_builder.Dockerfile debian_oldstable_builder.Dockerfile debian_builder.Dockerfile modern_toolbox_fedora.Dockerfile | |
git rm -r .github | |
git commit -m "${{ env.RELEASE_NAME }}" | |
git push -f -u origin release |