Skip to content

Commit

Permalink
support github packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Jared Allard committed Nov 2, 2023
1 parent 5da53ac commit eeebdf3
Show file tree
Hide file tree
Showing 4 changed files with 972 additions and 1,349 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"prettier": "^3.0.3",
"semantic-release": "^22.0.6",
"semver": "^7.5.4"
}
},
"packageManager": "[email protected]"
}
15 changes: 13 additions & 2 deletions shell/ci/auth/github_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,22 @@ EOF
fi

if command -v npm >/dev/null 2>&1; then
# Do not remove the empy newline, this ensures we never write to the same line
# as something else.
# Do not remove the empy newlines. They ensure that we never write to
# the same line as pre-existing content.

cat >>"$HOME/.npmrc" <<EOF
//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN
@$ORG:registry=https://npm.pkg.github.com
EOF

# Support yarn v2+
cat >>"$HOME/.yarnrc.yml" <<EOF
npmScopes:
"$ORG":
npmAlwaysAuth: true
npmAuthToken: "$GITHUB_TOKEN"
npmRegistryServer: "https://npm.pkg.github.com"
EOF
fi
11 changes: 11 additions & 0 deletions shell/devspace_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ if [[ -n $GH_TOKEN ]]; then
# shellcheck disable=SC2016
# shellcheck disable=SC2086
echo '//npm.pkg.github.com/:_authToken=${GH_TOKEN}' >>"$HOME/.npmrc"
echo '@getoutreach:registry=https://npm.pkg.github.com' >>"$HOME/.npmrc"

# Support yarn v2+
cat >>"$HOME/.yarnrc.yml" <<EOF
npmScopes:
"$ORG":
npmAlwaysAuth: true
npmAuthToken: "${GH_TOKEN}"
npmRegistryServer: "https://npm.pkg.github.com"
EOF

# We need bundler to be a thing so source ASDF
# shellcheck disable=SC1090
Expand Down
Loading

0 comments on commit eeebdf3

Please sign in to comment.