Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ jobs:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Setup PMG proxy
id: pmg-setup
uses: safedep/pmg@v1
with:
server-mode: true
api-key: ${{ secrets.PMG_PUBLIC_REPOS_TOKEN }}
tenant-id: ${{ secrets.PMG_TENANT_ID }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand All @@ -34,13 +41,28 @@ jobs:
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Enforce PMG policy
if: always()
run: |
if [ "${{ steps.pmg-setup.outcome }}" = "success" ]; then
pmg proxy stop --fail-on-violation
else
pmg proxy stop || true
fi

publish-npm:
if: startsWith(github.ref, 'refs/tags/v')
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PMG proxy
id: pmg-setup
uses: safedep/pmg@v1
with:
server-mode: true
api-key: ${{ secrets.PMG_PUBLIC_REPOS_TOKEN }}
tenant-id: ${{ secrets.PMG_TENANT_ID }}
- run: sudo apt-get install -y oathtool
- uses: actions/setup-node@v4
with:
Expand All @@ -49,3 +71,11 @@ jobs:
- run: npm ci
- run: npm config set //registry.npmjs.org/:_authToken ${{secrets.NPM_TOKEN}}
- run: npm publish --otp="$(oathtool -b --totp ${{secrets.NPM_SECRET_KEY}})"
- name: Enforce PMG policy
if: always()
run: |
if [ "${{ steps.pmg-setup.outcome }}" = "success" ]; then
pmg proxy stop --fail-on-violation
else
pmg proxy stop || true
fi
15 changes: 15 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Setup PMG proxy
id: pmg-setup
uses: safedep/pmg@v1
with:
server-mode: true
api-key: ${{ secrets.PMG_PUBLIC_REPOS_TOKEN }}
tenant-id: ${{ secrets.PMG_TENANT_ID }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand All @@ -29,3 +36,11 @@ jobs:
- run: npm install
- run: npm run build --if-present
- run: npm test
- name: Enforce PMG policy
if: always()
run: |
if [ "${{ steps.pmg-setup.outcome }}" = "success" ]; then
pmg proxy stop --fail-on-violation
else
pmg proxy stop || true
fi
Loading