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
2 changes: 1 addition & 1 deletion .github/workflow-templates/fe/fe-cleanup-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
cleanup-snapshots:
uses: collaborationFactory/github-actions/.github/workflows/fe-cleanup-snapshots.yml@master
secrets:
JFROG_BASE64_TOKEN: ${{ secrets.JFROG_BASE64_TOKEN }}
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}
JFROG_URL: ${{ secrets.JFROG_URL }}
JFROG_USER: ${{ secrets.JFROG_USER }}
DOT_NPMRC: ${{ secrets.DOT_NPMRC }}
2 changes: 1 addition & 1 deletion .github/workflow-templates/fe/fe-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ jobs:
GHA_REF: ''
GHA_BASE: ${{ github.event.before }}
secrets:
JFROG_BASE64_TOKEN: ${{ secrets.JFROG_BASE64_TOKEN }}
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}
JFROG_URL: ${{ secrets.JFROG_URL }}
JFROG_USER: ${{ secrets.JFROG_USER }}
2 changes: 1 addition & 1 deletion .github/workflow-templates/fe/fe-pr-close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
GHA_BASE: ${{ github.event.pull_request.base.ref }}
secrets:
JFROG_BASE64_TOKEN: ${{ secrets.JFROG_BASE64_TOKEN }}
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}
JFROG_URL: ${{ secrets.JFROG_URL }}
JFROG_USER: ${{ secrets.JFROG_USER }}
DOT_NPMRC: ${{ secrets.DOT_NPMRC }}
2 changes: 1 addition & 1 deletion .github/workflow-templates/fe/fe-pr-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
GHA_BASE: ${{ github.event.pull_request.base.ref }}
secrets:
JFROG_BASE64_TOKEN: ${{ secrets.JFROG_BASE64_TOKEN }}
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}
JFROG_URL: ${{ secrets.JFROG_URL }}
JFROG_USER: ${{ secrets.JFROG_USER }}
DOT_NPMRC: ${{ secrets.DOT_NPMRC }}
6 changes: 5 additions & 1 deletion .github/workflows/fe-cleanup-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ name: Cleanup Snapshot Artifacts on a CRON Schedule
on:
workflow_call:
secrets:
JFROG_TOKEN:
required: false
# deprecated, replaced by JFROG_TOKEN; used only when JFROG_TOKEN is not passed
JFROG_BASE64_TOKEN:
required: true
required: false
JFROG_URL:
required: true
JFROG_USER:
Expand Down Expand Up @@ -41,6 +44,7 @@ jobs:
- name: Cleanup Snapshot Artifacts
uses: collaborationFactory/github-actions/.github/actions/snapshots@master
env:
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}
JFROG_BASE64_TOKEN: ${{ secrets.JFROG_BASE64_TOKEN }}
JFROG_URL: ${{ secrets.JFROG_URL }}
JFROG_USER: ${{ secrets.JFROG_USER }}
6 changes: 5 additions & 1 deletion .github/workflows/fe-pr-close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ on:
type: string
required: true
secrets:
JFROG_TOKEN:
required: false
# deprecated, replaced by JFROG_TOKEN; used only when JFROG_TOKEN is not passed
JFROG_BASE64_TOKEN:
required: true
required: false
JFROG_URL:
required: true
JFROG_USER:
Expand Down Expand Up @@ -47,6 +50,7 @@ jobs:
- name: Delete Snapshots from NPM Registry
uses: collaborationFactory/github-actions/.github/actions/artifacts@master
env:
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}
JFROG_BASE64_TOKEN: ${{ secrets.JFROG_BASE64_TOKEN }}
JFROG_URL: ${{ secrets.JFROG_URL }}
JFROG_USER: ${{ secrets.JFROG_USER }}
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/fe-pr-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ on:
type: string
required: true
secrets:
JFROG_TOKEN:
required: false
# deprecated, replaced by JFROG_TOKEN; used only when JFROG_TOKEN is not passed
JFROG_BASE64_TOKEN:
required: true
required: false
JFROG_URL:
required: true
JFROG_USER:
Expand Down Expand Up @@ -65,6 +68,7 @@ jobs:
- name: Build and Push to Jfrog NPM Registry
uses: collaborationFactory/github-actions/.github/actions/artifacts@master
env:
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}
JFROG_BASE64_TOKEN: ${{ secrets.JFROG_BASE64_TOKEN }}
JFROG_URL: ${{ secrets.JFROG_URL }}
JFROG_USER: ${{ secrets.JFROG_USER }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/fe-release-flow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ on:
required: false
default: true
secrets:
JFROG_TOKEN:
required: false
# deprecated, replaced by JFROG_TOKEN; used only when JFROG_TOKEN is not passed
JFROG_BASE64_TOKEN:
required: true
required: false
JFROG_URL:
required: true
JFROG_USER:
Expand Down Expand Up @@ -149,6 +152,7 @@ jobs:
id: release
uses: collaborationFactory/github-actions/.github/actions/artifacts@master
env:
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}
JFROG_BASE64_TOKEN: ${{ secrets.JFROG_BASE64_TOKEN }}
JFROG_URL: ${{ secrets.JFROG_URL }}
JFROG_USER: ${{ secrets.JFROG_USER }}
Expand Down Expand Up @@ -186,6 +190,7 @@ jobs:
if: (failure() || cancelled()) && steps.incomplete.outputs.tag != ''
uses: collaborationFactory/github-actions/.github/actions/artifacts@master
env:
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}
JFROG_BASE64_TOKEN: ${{ secrets.JFROG_BASE64_TOKEN }}
JFROG_URL: ${{ secrets.JFROG_URL }}
JFROG_USER: ${{ secrets.JFROG_USER }}
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/fe-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ name: Frontend Release Workflow
on:
workflow_call:
secrets:
JFROG_TOKEN:
required: false
# deprecated, replaced by JFROG_TOKEN; used only when JFROG_TOKEN is not passed
JFROG_BASE64_TOKEN:
required: true
required: false
JFROG_URL:
required: true
JFROG_USER:
Expand Down Expand Up @@ -51,6 +54,7 @@ jobs:
- name: Build and Push to Jfrog NPM Registry
uses: collaborationFactory/github-actions/.github/actions/artifacts@master
env:
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}
JFROG_BASE64_TOKEN: ${{ secrets.JFROG_BASE64_TOKEN }}
JFROG_URL: ${{ secrets.JFROG_URL }}
JFROG_USER: ${{ secrets.JFROG_USER }}
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/fe-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ on:
type: string
required: true
secrets:
JFROG_TOKEN:
required: false
# deprecated, replaced by JFROG_TOKEN; used only when JFROG_TOKEN is not passed
JFROG_BASE64_TOKEN:
required: true
required: false
JFROG_URL:
required: true
JFROG_USER:
Expand Down Expand Up @@ -41,6 +44,7 @@ jobs:
- name: Build and Push to Jfrog NPM Registry
uses: collaborationFactory/github-actions/.github/actions/artifacts@master
env:
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}
JFROG_BASE64_TOKEN: ${{ secrets.JFROG_BASE64_TOKEN }}
JFROG_URL: ${{ secrets.JFROG_URL }}
JFROG_USER: ${{ secrets.JFROG_USER }}
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/fe-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ on:
type: string
required: true
secrets:
JFROG_TOKEN:
required: false
# deprecated, replaced by JFROG_TOKEN; used only when JFROG_TOKEN is not passed
JFROG_BASE64_TOKEN:
required: true
required: false
JFROG_URL:
required: true
JFROG_USER:
Expand Down Expand Up @@ -53,6 +56,7 @@ jobs:
- name: Bump Version and Push new Tag
uses: collaborationFactory/github-actions/.github/actions/artifacts@master
env:
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}
JFROG_BASE64_TOKEN: ${{ secrets.JFROG_BASE64_TOKEN }}
JFROG_URL: ${{ secrets.JFROG_URL }}
JFROG_USER: ${{ secrets.JFROG_USER }}
Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,32 @@ run ends green with the warning "FORCE is ignored".

### Required secrets

Passed with `secrets: inherit`: `JFROG_BASE64_TOKEN`, `JFROG_URL`, `JFROG_USER`, `DOT_NPMRC`,
Passed with `secrets: inherit`: `JFROG_TOKEN`, `JFROG_URL`, `JFROG_USER`, `DOT_NPMRC`,
`GIT_USER`, `GIT_USER_EMAIL`, and optionally `PERCY_TOKEN`. The caller needs
`permissions: contents: write`; the flow grants it only to the `release` and `github-release` jobs.

The tag is pushed with `GITHUB_TOKEN`; the flow does not use `GIT_USER_TOKEN`. The deprecated
`fe-tag.yml` and `workflows/fe-release.yml` still need it: remove it from a repo only once none of
its branches calls them.

#### JFrog and npm secrets (all FE workflows)

| Secret | Content | Used for |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `JFROG_URL` | URL of the npm repository artifacts are published to (`cplace-npm-local`); must end with `/`, or `npm publish` fails with ENEEDAUTH | `<scope>:registry=`, `publishConfig.registry`, `--registry=` and the credential key of the generated dist `.npmrc` |
| `JFROG_USER` | JFrog user that owns `JFROG_TOKEN` | logged as the publishing identity; not used for authentication |
| `JFROG_TOKEN` | JFrog reference token of `JFROG_USER` with deploy, delete and annotate rights on `cplace-npm-local` | publish, unpublish, `npm show` and `dist-tag`: written literally as `_authToken=${JFROG_TOKEN}` into the dist `.npmrc` and expanded by npm at runtime |
| `JFROG_BASE64_TOKEN` | **Deprecated.** `base64(user:secret)` | `_auth` in the dist `.npmrc`, only when `JFROG_TOKEN` is not passed; the run shows a deprecation warning |
| `DOT_NPMRC` | a complete `.npmrc` | installs (`npm ci`), `npm search`/`npm view` in snapshot cleanup, third-party registries; never used for publishing |

To migrate a repository: set the `JFROG_TOKEN` secret (and make `JFROG_USER` its owner), then replace the
`JFROG_BASE64_TOKEN:` line with `JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}` in every caller that references the
reusables `@master` or `@release/27.1` and later. Callers that reference `@release/26.4` or older stay unchanged:
those reusables do not declare `JFROG_TOKEN` and still require `JFROG_BASE64_TOKEN`. Workflows called with
`secrets: inherit` pick it up without an edit. Keep the `JFROG_BASE64_TOKEN` repository secret while a
release branch still passes it. A publishing or deleting run without either secret fails with "No JFrog
credentials".

### Tag rulesets

The tag is pushed as GitHub Actions (`GITHUB_TOKEN`), after publish and promote. A ruleset that
Expand Down
Loading