Skip to content
Merged
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
11 changes: 6 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,12 @@ jobs:
name: "Initialize NPM Configuration"
run: |
npmAuthToken="${{ env.NODE_AUTH_TOKEN }}"
echo "//repository.coremedia.com/nexus/repository/coremedia-npm/:_authToken=${npmAuthToken}" >> .npmrc
echo "@coremedia:registry=https://repository.coremedia.com/nexus/repository/coremedia-npm/" >> .npmrc
echo "@coremedia-internal:registry=https://repository.coremedia.com/nexus/repository/coremedia-npm/" >> .npmrc
# We must not commit this change.
git update-index --assume-unchanged .npmrc
# The .npmrc is not checked in (see .gitignore) and fully generated here.
{
echo "@coremedia:registry=https://repository.coremedia.com/nexus/repository/coremedia-npm/"
echo "@coremedia-internal:registry=https://repository.coremedia.com/nexus/repository/coremedia-npm/"
echo "//repository.coremedia.com/nexus/repository/coremedia-npm/:_authToken=${npmAuthToken}"
} > .npmrc
- id: installPnpm
name: "Install: Use PNPM ${{ env.pnpmVersion }}"
uses: pnpm/action-setup@v5
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/deploy-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,12 @@ jobs:
npmUrl="${{ env.npmUrl }}"
npmAuthToken="${{ env.NODE_AUTH_TOKEN }}"

echo "//${npmHost}/:_authToken=${npmAuthToken}" >> .npmrc
echo "@coremedia:registry=${npmUrl}" >> .npmrc
echo "@coremedia-internal:registry=${npmUrl}" >> .npmrc
# We must not commit this change.
git update-index --assume-unchanged .npmrc
# The .npmrc is not checked in (see .gitignore) and fully generated here.
{
echo "@coremedia:registry=${npmUrl}"
echo "@coremedia-internal:registry=${npmUrl}"
echo "//${npmHost}/:_authToken=${npmAuthToken}"
} > .npmrc
- id: installPnpm
name: "Install: Use PNPM ${{ env.pnpmVersion }}"
uses: pnpm/action-setup@v5
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/pre-release-gc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,15 @@ jobs:
exit 1
fi
echo "::add-mask::$NPM_AUTH_TOKEN"
echo "PNPM_CONFIG_//${{ env.NPM_REPOSITORY }}/:_authToken=${NPM_AUTH_TOKEN}" >> $GITHUB_ENV
echo "NPM_AUTH_TOKEN=${NPM_AUTH_TOKEN}" >> $GITHUB_ENV
echo "//${{ env.NPM_REPOSITORY }}/:_authToken=${NPM_AUTH_TOKEN}" > .npmrc
echo "@coremedia:registry=${{ env.NPM_REPOSITORY_URL }}" >> .npmrc
# The .npmrc is not checked in (see .gitignore) and fully generated here.
# pnpm ignores ${VAR} placeholders in registry credentials that come from
# a project .npmrc, so the resolved token has to be written out literally.
# The file is gitignored and the token is masked in the logs.
{
echo "@coremedia:registry=${{ env.NPM_REPOSITORY_URL }}"
echo "//${{ env.NPM_REPOSITORY }}/:_authToken=${NPM_AUTH_TOKEN}"
} > .npmrc
- name: "Performing Garbage Collection (retain: ${{ inputs.retain }}, dry-run: ${{ inputs.dryRun }})"
run: |
packages=($(npm search "@coremedia/ckeditor" --json --registry "${{ env.NPM_REPOSITORY_URL }}" | jq -r ".[].name"))
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,15 @@ jobs:
fi
echo "::add-mask::$NPM_AUTH_TOKEN"
echo "NPM_AUTH_TOKEN=$NPM_AUTH_TOKEN" >> $GITHUB_ENV
echo "PNPM_CONFIG_//repository.coremedia.com/nexus/repository/coremedia-npm/:_authToken=$NPM_AUTH_TOKEN" >> $GITHUB_ENV
echo "@coremedia:registry=https://repository.coremedia.com/nexus/repository/coremedia-npm/" >> .npmrc
echo "@coremedia-internal:registry=https://repository.coremedia.com/nexus/repository/coremedia-npm/" >> .npmrc
# The .npmrc is not checked in (see .gitignore) and fully generated here.
# pnpm ignores ${VAR} placeholders in registry credentials that come from
# a project .npmrc, so the resolved token has to be written out literally.
# The file is gitignored and the token is masked in the logs.
{
echo "@coremedia:registry=https://repository.coremedia.com/nexus/repository/coremedia-npm/"
echo "@coremedia-internal:registry=https://repository.coremedia.com/nexus/repository/coremedia-npm/"
echo "//repository.coremedia.com/nexus/repository/coremedia-npm/:_authToken=$NPM_AUTH_TOKEN"
} > .npmrc
- name: Setup Git
run: |
git config --global user.name 'coremedia-ci'
Expand Down Expand Up @@ -104,7 +110,6 @@ jobs:
if: github.event_name == 'workflow_dispatch'
run: |
pnpm install --production
echo '//repository.coremedia.com/nexus/repository/coremedia-npm/:_authToken=${NPM_AUTH_TOKEN}' > .npmrc
pnpm publishall --registry=https://repository.coremedia.com/nexus/repository/coremedia-npm/ --no-git-checks --tag pullrequest
# The "Set prerelease version" step pinned all @coremedia/* interdependencies
# to concrete versions so they could be published. Now that publishing is done,
Expand All @@ -113,8 +118,6 @@ jobs:
- name: Restore workspace dependency versions
if: github.event_name == 'workflow_dispatch'
run: |
# Avoid committing the auth token written to .npmrc during publishing.
git checkout -- .npmrc || true
echo "Restoring workspace dependency versions for: ${NEXT_VERSION}"
pnpm run setversion ${NEXT_VERSION} --filter=coremedia/* --dependencyVersion=workspace:^${NEXT_VERSION}
pnpm install --no-frozen-lockfile
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,15 @@ jobs:
fi
echo "::add-mask::$NPM_AUTH_TOKEN"
echo "NPM_AUTH_TOKEN=$NPM_AUTH_TOKEN" >> $GITHUB_ENV
echo "PNPM_CONFIG_//repository.coremedia.com/nexus/repository/coremedia-npm/:_authToken=$NPM_AUTH_TOKEN" >> $GITHUB_ENV
echo "@coremedia:registry=https://repository.coremedia.com/nexus/repository/coremedia-npm/" >> .npmrc
echo "@coremedia-internal:registry=https://repository.coremedia.com/nexus/repository/coremedia-npm/" >> .npmrc
# The .npmrc is not checked in (see .gitignore) and fully generated here.
# pnpm ignores ${VAR} placeholders in registry credentials that come from
# a project .npmrc, so the resolved token has to be written out literally.
# The file is gitignored and the token is masked in the logs.
{
echo "@coremedia:registry=https://repository.coremedia.com/nexus/repository/coremedia-npm/"
echo "@coremedia-internal:registry=https://repository.coremedia.com/nexus/repository/coremedia-npm/"
echo "//repository.coremedia.com/nexus/repository/coremedia-npm/:_authToken=$NPM_AUTH_TOKEN"
} > .npmrc
- name: Setup Git
run: |
git config --global user.name 'coremedia-ci'
Expand Down Expand Up @@ -135,7 +141,6 @@ jobs:
- name: Publish Release
if: github.event_name == 'workflow_dispatch'
run: |
echo '//repository.coremedia.com/nexus/repository/coremedia-npm/:_authToken=${NPM_AUTH_TOKEN}' > .npmrc
pnpm publishall --registry=https://repository.coremedia.com/nexus/repository/coremedia-npm/ --no-git-checks
git reset --hard
# The "Create Release Version" step pinned all @coremedia/* interdependencies
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/unpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,16 @@ jobs:
exit 1
fi
echo "::add-mask::$NPM_AUTH_TOKEN"
echo "PNPM_CONFIG_//repository.coremedia.com/nexus/repository/coremedia-npm/:_authToken=$NPM_AUTH_TOKEN" >> $GITHUB_ENV
echo "NPM_AUTH_TOKEN=$NPM_AUTH_TOKEN" >> $GITHUB_ENV
echo '//repository.coremedia.com/nexus/repository/coremedia-npm/:_authToken=${NPM_AUTH_TOKEN}' > .npmrc
# The .npmrc is not checked in (see .gitignore) and fully generated here.
# pnpm ignores ${VAR} placeholders in registry credentials that come from
# a project .npmrc, so the resolved token has to be written out literally.
# The file is gitignored and the token is masked in the logs.
{
echo "@coremedia:registry=https://repository.coremedia.com/nexus/repository/coremedia-npm/"
echo "@coremedia-internal:registry=https://repository.coremedia.com/nexus/repository/coremedia-npm/"
echo "//repository.coremedia.com/nexus/repository/coremedia-npm/:_authToken=$NPM_AUTH_TOKEN"
} > .npmrc
- name: Unpublish release
run: |
version=${{ github.event.inputs.version }}
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,12 @@ tmp/

# Results from `pnpm pack` (to test packaging)
*.tgz

### ----------------------------------------------------------------------------
### NPM
### ----------------------------------------------------------------------------

# The .npmrc is generated by the CI workflows (strict-ssl, registry mappings and
# the Nexus auth token) and must never be committed. Developers may keep their
# own local variant.
.npmrc
Comment on lines +69 to +72
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

Loading