Skip to content

Commit

Permalink
fix: npm suffix and tag
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Aug 22, 2024
1 parent 962499f commit 2023574
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,10 @@ jobs:
with:
result-encoding: string
script: |
const fullTag = context.payload.release.tag_name;
if (fullTag.includes('-')) {
const [, fullSuffix] = fullTag.split('-');
const [suffix] = fullSuffix.split('.');
return suffix;
const fullTag = "${{ inputs.tag }}" || context.payload.release.tag_name;
const firstMinusIndex = fullTag.indexOf('-');
if (firstMinusIndex !== -1) {
return fullTag.substring(firstMinusIndex);
} else {
return '';
}
Expand All @@ -100,15 +99,15 @@ jobs:
with:
result-encoding: string
script: |
const tag = inputs.tag || github.event.release.tag_name;
const tag = "${{ inputs.tag }}" || context.payload.release.tag_name;
const [, major, minor] = tag.match(/^v([0-9]+)\.([0-9]+)/);
return (tag.includes('-') ? `${major}.${minor}-${{steps.suffix.outputs.result}}` : 'latest');
- name: Configure NPM auth token
run: yarn config set npmAuthToken ${{ secrets.NPM_TOKEN }}

- name: Publish NPM packages
run: yarn workspaces foreach --all --no-private --parallel npm publish --access public --tag ${{ steps.tag.outputs.result }}
run: echo yarn workspaces foreach --all --no-private --parallel npm publish --access public --tag ${{ steps.tag.outputs.result }} ;exit 1

- name: Ignore only already cached artifacts
run: |
Expand Down

0 comments on commit 2023574

Please sign in to comment.