Skip to content

Commit

Permalink
ci: set up NPM publish
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgoff committed Aug 27, 2024
1 parent 69308da commit a4c6108
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 11 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ on:
- main

permissions:
contents: read # for checkout
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance

jobs:
release:
Expand Down Expand Up @@ -35,4 +38,5 @@ jobs:
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn release
5 changes: 4 additions & 1 deletion packages/epo-react-lib/.clean-publish
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
".storybook",
"src",
"storybook-static",
"publish"
"publish",
"postcss.config.ts",
"release.config.mjs",
".prettierignore"
]
}
7 changes: 6 additions & 1 deletion packages/epo-react-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"type": "git",
"url": "https://github.com/lsst-epo/epo-react-lib"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"tag": "latest"
},
"supportedLocales": [
"en",
"es"
Expand All @@ -27,7 +31,7 @@
"build-storybook:production": "yarn build-storybook -o ../../storybook-static",
"test": "NODE_OPTIONS=--experimental-vm-modules jest --max-workers=2",
"test:generate-output": "yarn test --json --outputFile=.jest-test-results.json || true",
"release": "semantic-release -e semantic-release-monorepo --debug"
"release": "yarn build && clean-publish --without-publish && semantic-release -e semantic-release-monorepo --debug"
},
"files": [
"CHANGELOG.md",
Expand Down Expand Up @@ -81,6 +85,7 @@
"@rubin-epo/epo-style-dictionary": "^0.1.0",
"@rubin-epo/eslint-config-react": "^1.0.0-beta",
"@semantic-release/github": "^10.1.7",
"@semantic-release/npm": "^12.0.1",
"@semantic-release/release-notes-generator": "^14.0.1",
"@storybook/addon-actions": "^7.6.3",
"@storybook/addon-essentials": "^7.6.3",
Expand Down
13 changes: 12 additions & 1 deletion packages/epo-react-lib/release.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,18 @@ const release = {
],
},
],
["@semantic-release/github"],
[
"@semantic-release/github",
{
assets: [{ path: "tempPublish/**", label: "Package" }],
},
],
[
"@semantic-release/npm",
{
pkgRoot: "tempPublish",
},
],
],
};

Expand Down
5 changes: 4 additions & 1 deletion packages/epo-widget-lib/.clean-publish
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
".storybook",
"src",
"storybook-static",
"publish"
"publish",
"postcss.config.ts",
"release.config.mjs",
".prettierignore"
]
}
1 change: 1 addition & 0 deletions packages/epo-widget-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"@babel/core": "^7.20.12",
"@rubin-epo/eslint-config-react": "^1.0.0-beta",
"@semantic-release/github": "^10.1.7",
"@semantic-release/npm": "^12.0.1",
"@semantic-release/release-notes-generator": "^14.0.1",
"@storybook/addon-a11y": "^7.6.3",
"@storybook/addon-actions": "^7.6.3",
Expand Down
13 changes: 12 additions & 1 deletion packages/epo-widget-lib/release.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,18 @@ const release = {
],
},
],
["@semantic-release/github"],
[
"@semantic-release/github",
{
assets: [{ path: "tempPublish/**", label: "Package" }],
},
],
[
"@semantic-release/npm",
{
pkgRoot: "tempPublish",
},
],
],
};

Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4303,7 +4303,7 @@
p-filter "^4.0.0"
url-join "^5.0.0"

"@semantic-release/npm@^12.0.0":
"@semantic-release/npm@^12.0.0", "@semantic-release/npm@^12.0.1":
version "12.0.1"
resolved "https://registry.yarnpkg.com/@semantic-release/npm/-/npm-12.0.1.tgz#ffb47906de95f8dade8fe0480df0a08dbe1b80c9"
integrity sha512-/6nntGSUGK2aTOI0rHPwY3ZjgY9FkXmEHbW9Kr+62NVOsyqpKKeP0lrCH+tphv+EsNdJNmqqwijTEnVWUMQ2Nw==
Expand Down Expand Up @@ -7385,10 +7385,10 @@ conventional-changelog-angular@^8.0.0:
dependencies:
compare-func "^2.0.0"

"conventional-changelog-conventionalcommits@>= 8.0.0", conventional-changelog-conventionalcommits@^7.0.2:
version "8.0.0"
resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-8.0.0.tgz#3fa2857c878701e7f0329db5a1257cb218f166fe"
integrity sha512-eOvlTO6OcySPyyyk8pKz2dP4jjElYunj9hn9/s0OB+gapTO8zwS9UQWrZ1pmF2hFs3vw1xhonOLGcGjy/zgsuA==
conventional-changelog-conventionalcommits@^7.0.2:
version "7.0.2"
resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-7.0.2.tgz#aa5da0f1b2543094889e8cf7616ebe1a8f5c70d5"
integrity sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==
dependencies:
compare-func "^2.0.0"

Expand Down

0 comments on commit a4c6108

Please sign in to comment.