Skip to content

Commit

Permalink
refactor: use changesets instead of semantic-releases
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinEspinas committed Aug 21, 2024
1 parent 7d499eb commit 8887d0d
Show file tree
Hide file tree
Showing 8 changed files with 670 additions and 119 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/changelog-github", { "repo": "ineka/engine" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/slow-icons-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ineka/engine": patch
---

Updated project tooling
81 changes: 40 additions & 41 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,69 +3,68 @@ on:
push:
branches:
- main
- next
- beta
- alpha
jobs:
build-and-test:
build:
name: Build and test project before release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Use Node.js LTS
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
cache: pnpm

- name: Install dependencies
run: npm ci --prefer-offline
- name: Build project
run: npm run build
- name: Lint project code
run: npm run lint
- uses: actions/upload-artifact@v2
run: pnpm install

- name: Build sources
run: pnpm build

- uses: actions/upload-artifact@v4
with:
name: build
path: dist

release:
name: Release
runs-on: ubuntu-latest
needs: [build-and-test]
needs: [build]
with:
fetch-depth: 0
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Use Node.js LTS
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
cache: pnpm

- name: Install dependencies
run: npm ci --prefer-offline
- uses: actions/download-artifact@v2
run: pnpm install

- uses: actions/download-artifact@v4
with:
name: build
path: dist
- env:

- name: Create Release Pull Request or Publish to npm
uses: changesets/action@v1
with:
publish: pnpm release
version: pnpm version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
66 changes: 0 additions & 66 deletions .releaserc

This file was deleted.

12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
<br>
<br>
<a href="https://www.npmjs.com/package/@ineka/engine"><img alt="npm" src="https://img.shields.io/npm/v/@ineka/engine?style=for-the-badge"></a>
<a href="https://www.npmjs.com/package/@ineka/engine"><img alt="npm (tag)" src="https://img.shields.io/npm/v/@ineka/engine/next?style=for-the-badge"></a>
<a href="https://github.com/ineka-dev/engine/actions/workflows/release.yml"><img alt="GitHub Workflow Status Release" src="https://img.shields.io/github/actions/workflow/status/ineka-dev/engine/release.yml?logo=github&style=for-the-badge"></a>
<a href="https://github.com/ineka-dev/engine/actions/workflows/release.yml"><img alt="GitHub Workflow Status Release" src="https://img.shields.io/github/actions/workflow/status/ineka-dev/engine/release.yml?logo=github&style=for-the-badge"></a>
<a href="https://github.com/ineka-dev/engine/actions/workflows/docs.yml"><img alt="GitHub Workflow Status Documentation" src="https://img.shields.io/github/actions/workflow/status/ineka-dev/engine/docs.yml?label=docs&logo=github&style=for-the-badge"></a>
<a href="https://github.com/ineka-dev/engine/blob/main/LICENSE"><img alt="GitHub" src="https://img.shields.io/github/license/ineka-dev/engine?color=black&style=for-the-badge"></a>
<a href="https://github.com/ineka-dev/engine/issues"><img alt="GitHub issues" src="https://img.shields.io/github/issues-raw/ineka-dev/engine?style=for-the-badge">
Expand Down Expand Up @@ -57,15 +56,6 @@ This concept aims to **reduce bloat** and offer **a large panel of customization

[**Find more about available packages here**](https://github.com/ineka-dev/packages)

## CI/CD Workflows

This project uses GitHub Actions for CI/CD jobs.

We have workflows to:
- Build and test the project on each pull request.
- Build, test and release the project.
- Generate a documentation and deploy it.

## Contributing
Any help and contribution is welcome, feel free to submit issues and/or contribute to the project.

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
"docs": "typedoc ./src",
"lint": "eslint . --flag unstable_ts_config",
"lint:fix": "eslint . --fix --flag unstable_ts_config",
"semantic-release": "semantic-release"
"release": "changeset publish",
"version": "changeset version"
},
"dependencies": {
"nanoid": "^5.0.7"
},
"devDependencies": {
"@antfu/eslint-config": "^2.27.0",
"@changesets/cli": "^2.27.7",
"@rollup/plugin-typescript": "^11.1.6",
"@types/node": "^22.4.2",
"esbuild": "^0.23.1",
Expand Down
Loading

0 comments on commit 8887d0d

Please sign in to comment.