Skip to content

Commit

Permalink
Merge pull request #15 from inversify/chore/add-publish-gh-action
Browse files Browse the repository at this point in the history
Add publish gh action
  • Loading branch information
notaphplover authored Oct 16, 2024
2 parents d6fdcd0 + 5bfde13 commit e5319d0
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/publish.yaml
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 }}
3 changes: 2 additions & 1 deletion docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

Welcome to the developer docs.

- [Testing docs](./testing/index.md).
- [Release docs](./release.md).
- [Setup docs](./setup.md).
- [Testing docs](./testing/index.md).
14 changes: 14 additions & 0 deletions docs/release.md
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

0 comments on commit e5319d0

Please sign in to comment.