-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from inversify/chore/add-publish-gh-action
Add publish gh action
- Loading branch information
Showing
3 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: publish | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
on: | ||
workflow_dispatch: | ||
secrets: | ||
NPM_TOKEN: | ||
required: false | ||
jobs: | ||
publish: | ||
name: Bump package versions and publish to npm. | ||
environment: CI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: ./.github/actions/setup | ||
|
||
- id: create_token | ||
uses: tibdex/github-app-token@v2 | ||
with: | ||
app_id: ${{ vars.GH_APP_ID }} | ||
private_key: ${{ secrets.GH_APP_PRIVATE_KEY }} | ||
|
||
- name: Create Release Pull or publish changes | ||
uses: changesets/action@v1 | ||
with: | ||
commit: "chore: bump package versions" | ||
publish: pnpm run release | ||
title: "[Changesets] Bump package versions" | ||
env: | ||
GITHUB_TOKEN: ${{ steps.create_token.outputs.token }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Release | ||
|
||
Manually releasing all the packages of a monorepo can be as challenging as inappropriate. For such a reason we rely on changesets, GH actions and as less as possible manual steps. | ||
|
||
## Requirements | ||
|
||
- Privileges to trigger GH actions. | ||
- Proper changesets to be deployed. | ||
|
||
## Steps | ||
|
||
### Publish npm packages | ||
|
||
Run the `publish` GH action. This should generate a PR with version bumps and changelogs updates. After carefully reviewing the PR, merge it and run the `publish` action again, passing an `NPM_TOKEN` with privileges to publish in the `@inversifyjs` npm org. This should trigger an attempt to publish npm packages and generate github releases |