Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit d2f1e60

Browse files
authored
Patch version of twitch-auth package in published tarballs (#894)
* Patch version of twitch-auth dependencies in published tarballs Makes twitch services work in generated bundles of nodecg-io-cli development environments. See #893 (comment) for a more detailed explanation. * Install ripgrep in GitHub Actions tarball publish step * Add debug information to hopefuly fix publish action * Remove ripgrep from tarball publish action
1 parent bc6d3aa commit d2f1e60

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,22 @@ jobs:
166166
- name: Extract compilation results
167167
run: tar xvf compilation-results.tar.gz
168168

169+
# All twitch services depend on the utility package `nodecg-io-twitch-auth`.
170+
# In the repository the services depend on the latest development version which is not yet published.
171+
# If someone installs the service using the published tarball npm would try to get the
172+
# unpublished version of twitch-auth from the npm registry which is not possible.
173+
# To fix this we update the version of the twitch-auth package in all usages
174+
# to also reference the published tarball.
175+
- name: Patch twitch-auth dependency to use published current tarball
176+
run: |
177+
# Get current version as it is needed for the tarball file name
178+
TWITCH_AUTH_VERSION=$(cat utils/nodecg-io-twitch-auth/package.json | jq .version -r)
179+
180+
# Find usages in all package.json files and replace with the corresponding tarball url
181+
find . -name 'package.json' -exec grep -q -E '"nodecg-io-twitch-auth": ".+"' {} \; -print # Print found files for debug purposes
182+
find . -name 'package.json' -exec grep -q -E '"nodecg-io-twitch-auth": ".+"' {} \; -print0 | \
183+
xargs -0 sed -i "s/\"nodecg-io-twitch-auth\": \".*\"/\"nodecg-io-twitch-auth\": \"https:\/\/codeoverflow-org.github.io\/nodecg-io-publish\/nodecg-io-twitch-auth-${TWITCH_AUTH_VERSION}.tgz\"/g"
184+
169185
- name: Create npm tarballs
170186
run: npm pack --workspaces
171187

0 commit comments

Comments
 (0)