Skip to content

Commit b304ebc

Browse files
author
Christopher J Baker
committed
fix workflow
1 parent 974753a commit b304ebc

File tree

9 files changed

+48
-15
lines changed

9 files changed

+48
-15
lines changed

.github/actions/build/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: monorepo-build
22

33
inputs:
44
package:
5-
description: "The package folder name."
5+
description: "The package name."
66
required: true
77

88
runs:

.github/actions/job-publish/action.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
name: monorepo-job-publish
22

33
inputs:
4+
directory:
5+
description: "The directory name."
6+
required: true
7+
npm-token:
8+
description: "The token for publishing the package to npm."
9+
required: true
10+
github-token:
11+
description: "The token for pushing tags and version changes to github.."
12+
required: true
413
segment:
514
description: "The version segment to increment: major, minor, patch, or prerelease."
615
required: true
@@ -23,5 +32,8 @@ runs:
2332
uses: ./.github/actions/publish-npm
2433
with:
2534
package: ${{ github.workflow }}
26-
segment: ${{ github.event.inputs.segment }}
27-
preId: ${{ github.event.inputs.preId }}
35+
directory: ${{ inputs.directory }}
36+
npm-token: ${{ inputs.npm-token }}
37+
github-token: ${{ inputs.github-token }}
38+
segment: ${{ inputs.segment }}
39+
preId: ${{ inputs.preId }}

.github/actions/publish-npm/action.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@ name: monorepo-publish-npm
22

33
inputs:
44
package:
5-
description: "The package folder name."
5+
description: "The package name."
6+
required: true
7+
directory:
8+
description: "The directory name."
9+
required: true
10+
npm-token:
11+
description: "The token for publishing the package to npm."
12+
required: true
13+
github-token:
14+
description: "The token for pushing tags and version changes to github.."
615
required: true
716
segment:
817
description: "The version segment to increment: major, minor, patch, or prerelease."
@@ -30,28 +39,28 @@ runs:
3039
git config --local user.email "Workflow: ${{ inputs.package }}[bot]"
3140
git config --local user.name "${{ inputs.package }}[bot]@workflow"
3241
33-
TAG_CMD="--tag-version-prefix=\"${{ inputs.package }}/v\""
34-
MESSAGE_CMD="-m \"Publish ${{ inputs.package }} v%s\""
42+
TAG_CMD="--tag-version-prefix ${{ inputs.package }}/v"
43+
MESSAGE="Publish ${{ inputs.package }} v%s"
3544
3645
if [[ ${{ inputs.segment }} == pre* ]]; then
3746
if [[ -n "${{ inputs.preId }}" ]]; then
3847
PREID_CMD="--preid ${{ inputs.preId }}"
3948
fi
4049
fi
4150
42-
npm version ${{ inputs.segment }} $PREID_CMD $TAG_CMD $MESSAGE_CMD"
51+
npm version ${{ inputs.segment }} $PREID_CMD $TAG_CMD -m "$MESSAGE"
4352
4453
- name: Push Tag
4554
uses: ad-m/github-push-action@master
4655
with:
47-
github_token: ${{ secrets.GITHUB_TOKEN }}
56+
github_token: ${{ inputs.github-token }}
4857
branch: ${{ github.ref }}
4958
tags: true
5059

5160
- name: Publish to NPM Registry
52-
working-directory: ${{ inputs.package }}
5361
uses: JS-DevTools/npm-publish@v2
5462
with:
55-
token: ${{ secrets.NPM_TOKEN }}
63+
token: ${{ inputs.npm-token }}
64+
package: ./packages/${{ inputs.directory }}
65+
access: public
5666
tag: ${{ steps.tag.outputs.tag }}
57-
dry-run: true

.github/actions/test/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: monorepo-test
22

33
inputs:
44
package:
5-
description: "The package folder name."
5+
description: "The package name."
66
required: true
77

88
runs:

.github/workflows/core.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,8 @@ jobs:
4040
- name: Publish
4141
uses: ./.github/actions/job-publish
4242
with:
43+
directory: core
44+
npm-token: ${{ secrets.NPM_TOKEN }}
45+
github-token: ${{ secrets.GITHUB_TOKEN }}
4346
segment: ${{ github.event.inputs.segment }}
4447
preId: ${{ github.event.inputs.preId }}

.github/workflows/legacy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,8 @@ jobs:
4040
- name: Publish
4141
uses: ./.github/actions/job-publish
4242
with:
43+
directory: legacy
44+
npm-token: ${{ secrets.NPM_TOKEN }}
45+
github-token: ${{ secrets.GITHUB_TOKEN }}
4346
segment: ${{ github.event.inputs.segment }}
4447
preId: ${{ github.event.inputs.preId }}

.github/workflows/react-to-web-component.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,8 @@ jobs:
4040
- name: Publish
4141
uses: ./.github/actions/job-publish
4242
with:
43+
directory: react-to-web-component
44+
npm-token: ${{ secrets.NPM_TOKEN }}
45+
github-token: ${{ secrets.GITHUB_TOKEN }}
4346
segment: ${{ github.event.inputs.segment }}
4447
preId: ${{ github.event.inputs.preId }}

package-lock.json

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@
2424
"semver": "^7.5.0",
2525
"ts-node": "^10.9.1",
2626
"typescript": "^4.9.5"
27-
}
27+
},
28+
"version": "0.0.1-alpha.1"
2829
}

0 commit comments

Comments
 (0)