GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tools: add automation for updating base64 dependency · nodejs/node@75a146f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • tools.yml
  • tools
    • update-base64.sh
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/tools.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/tools.yml
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,24 @@ jobs:
7878
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
7979
./tools/update-undici.sh
8080
fi
81+
- id: base64
82+
subsystem: deps
83+
label: dependencies
84+
run: |
85+
NEW_VERSION=$(gh api repos/aklomp/base64/releases/latest -q '.tag_name|ltrimstr("v")')
86+
CURRENT_VERSION=$(grep "base64 LANGUAGES C VERSION" ./deps/base64/base64/CMakeLists.txt | \
87+
sed -n "s/^.*VERSION \(.*\))/\1/p")
88+
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
89+
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
90+
./tools/update-base64.sh "$NEW_VERSION"
91+
fi
8192
steps:
8293
- uses: actions/checkout@v3
8394
with:
8495
persist-credentials: false
8596
- run: ${{ matrix.run }}
97+
env:
98+
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
8699
- uses: gr2m/create-or-update-pull-request-action@dc1726cbf4dd3ce766af4ec29cfb660e0125e8ee
87100
# Creates a PR or update the Action's existing PR, or
88101
# no-op if the base branch is already up-to-date.
Collapse file

‎tools/update-base64.sh‎

Copy file name to clipboard
+43Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/sh
2+
set -e
3+
# Shell script to update base64 in the source tree to a specific version
4+
5+
BASE_DIR=$(cd "$(dirname "$0")/.." && pwd)
6+
DEPS_DIR="$BASE_DIR/deps"
7+
BASE64_VERSION=$1
8+
9+
if [ "$#" -le 0 ]; then
10+
echo "Error: please provide an base64 version to update to"
11+
echo " e.g. $0 0.4.0"
12+
exit 1
13+
fi
14+
15+
echo "Making temporary workspace"
16+
17+
WORKSPACE=$(mktemp -d 2> /dev/null || mktemp -d -t 'tmp')
18+
19+
cleanup () {
20+
EXIT_CODE=$?
21+
[ -d "$WORKSPACE" ] && rm -rf "$WORKSPACE"
22+
exit $EXIT_CODE
23+
}
24+
25+
trap cleanup INT TERM EXIT
26+
27+
cd "$WORKSPACE"
28+
29+
echo "Fetching base64 source archive"
30+
curl -sL "https://api.github.com/repos/aklomp/base64/tarball/v$BASE64_VERSION" | tar xzf -
31+
mv aklomp-base64-* base64
32+
33+
echo "Replacing existing base64"
34+
rm -rf "$DEPS_DIR/base64/base64"
35+
mv "$WORKSPACE/base64" "$DEPS_DIR/base64/"
36+
37+
echo "All done!"
38+
echo ""
39+
echo "Please git add base64/base64, commit the new version:"
40+
echo ""
41+
echo "$ git add -A deps/base64/base64"
42+
echo "$ git commit -m \"deps: update base64 to $BASE64_VERSION\""
43+
echo ""

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.