npm #9945
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: "npm" | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
install: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4.2.1 | |
with: | |
path: DownloadItYourself | |
- name: install | |
shell: bash | |
run: | | |
cd DownloadItYourself | |
bash --noprofile --norc -e -o pipefail docs/tools/git-config.sh | |
git fetch --depth 1 origin +refs/tags/artifacts:refs/tags/artifacts --no-tags | |
git restore --source=artifacts -- bin/ | |
bash --noprofile --norc -e -o pipefail docs/tools/actions-npm.sh | |
export node_version=$(cat package.json | python -c "import sys, json; print(json.load(sys.stdin)['engines']['node'])") | |
sed -i '/cache-max = 0/d' -- '.npmrc' | |
sed -i '/only = prod/d' -- '.npmrc' | |
sed -i '/optional = false/d' -- '.npmrc' | |
sed -i '/production = true/d' -- '.npmrc' | |
bin/linux/x64/node/node-v$node_version-linux-x64/bin/node node_modules/npm/bin/npm-cli.js ls || true | |
rm -rf .npm/ | |
git checkout -- '.npmrc' | |
# Ignore peerDependencies | |
sed -i '/"peerDependencies": {/,/}/d' -- 'package.json' | |
cd .. | |
echo '{ | |
"private": "true" | |
}' > package.json | |
cp DownloadItYourself/.npmrc .npmrc | |
DownloadItYourself/bin/linux/x64/node/node-v$node_version-linux-x64/bin/node DownloadItYourself/bin/linux/x64/node/node-v$node_version-linux-x64/lib/node_modules/npm/bin/npm-cli.js install ./DownloadItYourself | |
rm -rf .npm/ | |
audit: | |
runs-on: ubuntu-latest | |
needs: [install] | |
if: ${{ needs.install.result == 'success' }} | |
steps: | |
- uses: actions/checkout@v4.2.1 | |
- name: audit | |
shell: bash | |
run: | | |
bash --noprofile --norc -e -o pipefail docs/tools/git-config.sh | |
git fetch --depth 1 origin +refs/tags/artifacts:refs/tags/artifacts --no-tags | |
git restore --source=artifacts -- bin/ | |
bash --noprofile --norc -e -o pipefail docs/tools/actions-npm.sh | |
bash --noprofile --norc -e -o pipefail docs/tools/actions-audit.sh |