From b15028ea393705a852251a018fa115483afe6fa2 Mon Sep 17 00:00:00 2001 From: Marcarrian Date: Fri, 8 Sep 2023 14:22:47 +0200 Subject: [PATCH] ci: create GitHub release when released to NPM --- .github/workflows/workflow.yml | 10 ++++++++++ CONTRIBUTING.md | 19 +++++++++++-------- package.json | 8 ++++++-- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 5cea3219..b3d2c05c 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -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' }} @@ -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' }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 45fbfc43..4896175d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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) @@ -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 diff --git a/package.json b/package.json index deeeda9a..d928b04b 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,9 @@ "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", @@ -31,7 +33,9 @@ "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",