Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add publish gh action #15

Merged
merged 3 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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