Skip to content

Commit

Permalink
ci: create GitHub release when released to NPM
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcarrian authored and danielwiehl committed Sep 21, 2023
1 parent e9d88dd commit b15028e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,11 @@ jobs:
dist-folder: dist/scion/toolkit
npm-token: ${{ secrets.NPM_TOKEN }}
dry-run: false
- name: 'Creating GitHub Release'
run: gh release create toolkit-$VERSION --title "$VERSION (@scion/toolkit)" --notes-file CHANGELOG_TOOLKIT_LATEST.md --verify-tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ needs.build-libs.outputs.toolkit-version }}
release-components:
name: 'Releasing @scion/components'
if: ${{ needs.components-release-guard.outputs.should-release == 'true' }}
Expand All @@ -310,6 +315,11 @@ jobs:
dist-folder: dist/scion/components
npm-token: ${{ secrets.NPM_TOKEN }}
dry-run: false
- name: 'Creating GitHub Release'
run: gh release create components-$VERSION --title "$VERSION (@scion/components)" --notes-file CHANGELOG_COMPONENTS_LATEST.md --verify-tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ needs.build-libs.outputs.components-version }}
release-components-internal:
name: 'Releasing @scion/components.internal'
if: ${{ needs.components-internal-release-guard.outputs.should-release == 'true' }}
Expand Down
19 changes: 11 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,10 @@ Instructions for releasing the `@scion/toolkit` module.
2. Run `npm run toolkit:changelog` to generate the changelog. Then, review the generated changelog carefully and correct typos and formatting errors, if any.
3. Commit the changed files using the following commit message: `release(toolkit): vX.X.X`. Replace `X.X.X` with the current version. Later, when merging the branch into the master branch, a commit message of this format triggers the release action in our [GitHub Actions workflow][link-github-actions-workflow].
4. Push the commit to the branch `release/toolkit-X.X.X` and submit a pull request to the master branch. Replace `X.X.X` with the current version.
5. When merged into the master branch, the release action in our [GitHub Actions workflow][link-github-actions-workflow] creates a Git release tag, publishes the package to NPM, and deploys related applications.
6. Verify that:
- `@scion/toolkit` is published to: https://www.npmjs.com/package/@scion/toolkit.
- `Components App` is deployed to: https://components.scion.vercel.app and https://components-vX-X-X.scion.vercel.app.
5. When merged into the master branch, the release action in our [GitHub Actions workflow][link-github-actions-workflow] does the following:
- Creates a Git release tag
- Publishes `@scion/toolkit` package to NPM (https://www.npmjs.com/package/@scion/toolkit)
- Creates a release on GitHub (https://github.com/SchweizerischeBundesbahnen/scion-toolkit/releases)

</details>

Expand All @@ -319,10 +319,13 @@ Instructions for releasing the `@scion/components` module.
2. Run `npm run components:changelog` to generate the changelog. Then, review the generated changelog carefully and correct typos and formatting errors, if any.
3. Commit the changed files using the following commit message: `release(components): vX.X.X`. Replace `X.X.X` with the current version. Later, when merging the branch into the master branch, a commit message of this format triggers the release action in our [GitHub Actions workflow][link-github-actions-workflow].
4. Push the commit to the branch `release/components-X.X.X` and submit a pull request to the master branch. Replace `X.X.X` with the current version.
5. When merged into the master branch, the release action in our [GitHub Actions workflow][link-github-actions-workflow] creates a Git release tag, publishes the package to NPM, and deploys related applications.
6. Verify that:
- `@scion/components` is published to: https://www.npmjs.com/package/@scion/components.
- `Components App` is deployed to: https://components.scion.vercel.app and https://components-vX-X-X.scion.vercel.app.
5. When merged into the master branch, the release action in our [GitHub Actions workflow][link-github-actions-workflow] does the following.
- Creates a Git release tag
- Publishes `@scion/components` package to NPM (https://www.npmjs.com/package/@scion/components)
- Creates a release on GitHub (https://github.com/SchweizerischeBundesbahnen/scion-toolkit/releases)
- Deploys following apps to Vercel:
- https://components.scion.vercel.app
- https://components-vX-X-X.scion.vercel.app

</details>

Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@
"toolkit:lint": "ng lint @scion/toolkit",
"toolkit:test": "ng test @scion/toolkit",
"toolkit:build": "ng build --configuration production @scion/toolkit",
"toolkit:changelog": "conventional-changelog --commit-path projects/scion/toolkit -k projects/scion/toolkit -t toolkit- -p angular -i CHANGELOG_TOOLKIT.md -s && markdown-include docs/site/changelog-toolkit/changelog.template.json",
"toolkit:changelog": "run-p toolkit:changelog:*",
"toolkit:changelog:full": "conventional-changelog --commit-path projects/scion/toolkit -k projects/scion/toolkit -t toolkit- -p angular -i CHANGELOG_TOOLKIT.md -s && markdown-include docs/site/changelog-toolkit/changelog.template.json",
"toolkit:changelog:latest": "conventional-changelog --commit-path projects/scion/toolkit -k projects/scion/toolkit -t toolkit- -p angular -o CHANGELOG_TOOLKIT_LATEST.md",

"components:lint": "ng lint @scion/components",
"components:test": "ng test @scion/components",
"components:e2e:run": "tsc --incremental -p projects/scion/components.e2e/tsconfig.json && cross-env PLAYWRIGHT_BROWSERS_PATH=0 playwright test --config out-tsc/components.e2e",
"components:e2e:debug": "tsc --incremental -p projects/scion/components.e2e/tsconfig.json && cross-env PLAYWRIGHT_BROWSERS_PATH=0 PWDEBUG=1 playwright test --config out-tsc/components.e2e",
"components:e2e:lint": "ng lint @scion/components.e2e",
"components:build": "ng build --configuration production @scion/components",
"components:changelog": "conventional-changelog --commit-path projects/scion/components -k projects/scion/components -t components- -p angular -i CHANGELOG_COMPONENTS.md -s && markdown-include docs/site/changelog-components/changelog.template.json",
"components:changelog": "run-p components:changelog:*",
"components:changelog:full": "conventional-changelog --commit-path projects/scion/components -k projects/scion/components -t components- -p angular -i CHANGELOG_COMPONENTS.md -s && markdown-include docs/site/changelog-components/changelog.template.json",
"components:changelog:latest": "conventional-changelog --commit-path projects/scion/components -k projects/scion/components -t components- -p angular -o CHANGELOG_COMPONENTS_LATEST.md",

"components.internal:lint": "ng lint @scion/components.internal",
"components.internal:test": "ng test @scion/components.internal",
Expand Down

0 comments on commit b15028e

Please sign in to comment.