Skip to content

Commit

Permalink
CI: Publish and Changelog automation (#19)
Browse files Browse the repository at this point in the history
* feat: add changeset to automate changelog

* ci: create publish automation
  • Loading branch information
ortense authored Jan 6, 2024
1 parent 203828b commit cc0d0be
Show file tree
Hide file tree
Showing 7 changed files with 1,674 additions and 22 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/shy-parrots-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ortense/mediator": patch
---

Publish and Changelog automation
12 changes: 6 additions & 6 deletions .github/workflows/workflow.yaml → .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@ on: ["push", "pull_request"]
jobs:
continuous-integration:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Intall Dependencies
run: pnpm install

- name: Build
run: pnpm build

- name: Run tests
run: pnpm test:coverage

- name: Coveralls
uses: coverallsapp/github-action@v2
48 changes: 48 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: release-publish
on:
workflow_run:
workflows: [continuous-integration]
branches: [main]
types: [completed]

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write
pull-requests: write

jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Intall Dependencies
run: pnpm install

- name: Build
run: pnpm build

- name: Run tests
run: pnpm test

- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@
"build": "tsup --minify",
"lint": "eslint src",
"lint:fix": "eslint --fix src",
"doc": "typedoc"
"doc": "typedoc",
"change": "changeset",
"release": "tsup --minify && typedoc && changeset publish --access public"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"@vitest/coverage-v8": "^0.34.6",
Expand All @@ -58,6 +61,11 @@
"files": [
"./dist",
"README.md",
"LICENSE"
]
"LICENSE",
"CHANGELOG.md"
],
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}
Loading

0 comments on commit cc0d0be

Please sign in to comment.