Skip to content

Commit

Permalink
feat!: remove support for pre-compiled packages
Browse files Browse the repository at this point in the history
This commit drops the support of pre-compiled packages in favor
of providing a Node executable binary, which is also compatible
with pre-commit hooks.
  • Loading branch information
KevinDeJong-TomTom committed Apr 3, 2024
1 parent 133ceab commit 2d23182
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 74 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,35 +36,6 @@ jobs:
create-release: true
token: ${{ github.token }}
version-prefix: v

release-packages:
name: Release Packages
runs-on: ubuntu-latest
needs: github-release
if: needs.github-release.outputs.next-version != ''

steps:
- uses: actions/checkout@v4

- name: Set up Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Install dependencies
run: npm ci

- name: Rebuild the dist/ directory
run: npm run build

- name: Package the CLI
run: npm run package

- uses: AButler/upload-release-assets@v2.0
with:
files: 'bin/*'
repo-token: ${{ github.token }}
release-tag: ${{ needs.github-release.outputs.next-version }}

release-action:
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- id: commisery
name: Commisery - Conventional Commit message validation
description: Validates your commits agains the Conventional Commits specification
entry: commisery
language: node
stages: [commit-msg]
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Conventional Commit Messages
[![Download](https://img.shields.io/badge/Download-Linux%20x64-blue)](https://github.com/tomtom-international/commisery-action/releases/latest/download/commisery-linux-x64) [![Download](https://img.shields.io/badge/Download-MacOS%20arm64-blue)](https://github.com/tomtom-international/commisery-action/releases/latest/download/commisery-macos-arm64) [![Download](https://img.shields.io/badge/Download-MacOS%20x64-blue)](https://github.com/tomtom-international/commisery-action/releases/latest/download/commisery-macos-x64)

This GitHub Action consists of two major components:

Expand Down
3 changes: 3 additions & 0 deletions bin/commisery
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env node

require('../dist/cli/index.js');
19 changes: 0 additions & 19 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,6 @@

A stand-alone CLI tool is provided as part of the `commisery-action` package.

## Installation

You can download the latest version directly from GitHub.
We currently support the following architectures:

- [MacOS x86](https://github.com/tomtom-international/commisery-action/releases/latest/download/commisery-macos-x64)
- [MacOS ARM64](https://github.com/tomtom-international/commisery-action/releases/latest/download/commisery-macos-arm64)
- [Linux x86](https://github.com/tomtom-international/commisery-action/releases/latest/download/commisery-linux-x64)

We recommend renaming the binary to `commisery`...
```sh
$ mv commisery-[linux-x64|macos-x64|macos-arm64] commisery
```

...and ensure that you provide execution rights;
```sh
$ chmod +x commisery
```

## Compliance Check

You can use the `check` command to validate your commit messages for compliance with [Conventional Commits]:
Expand Down
42 changes: 17 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
{
"name": "commisery",
"description": "Validate your Pull Request against Conventional Commit compliance",
"main": "./dist/cli/index.js",
"bin": "./dist/cli/index.js",
"files": [
"./dist/cli/index.js"
"version": "1.0.0",
"author": "Kevin de Jong",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/tomtom-international/commisery-action.git"
},
"keywords": [
"github",
"action",
"conventional-commits",
"pre-commit"
],
"pkg": {
"scripts": "dist/cli/index.js",
"targets": [
"node20-macos-x64",
"node20-macos-arm64",
"node20-linux-x64"
],
"outputPath": "bin",
"compress": "GZip"
"homepage": "https://github.com/tomtom-international/commisery-action#readme",
"bugs": {
"url": "https://github.com/tomtom-international/commisery-action/issues"
},
"version": "1.0.0",
"scripts": {
"build": "run-p build:*",
"build:cli": "ncc build -o dist/cli src/cli/cli.ts",
Expand All @@ -27,17 +28,9 @@
"format": "prettier --write **/*.ts",
"package": "pkg ."
},
"repository": {
"type": "git",
"url": "git+https://github.com/tomtom-international/commisery-action.git"
},
"keywords": [],
"author": "Kevin de Jong",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/tomtom-international/commisery-action/issues"
"bin": {
"commisery": "./bin/commisery"
},
"homepage": "https://github.com/tomtom-international/commisery-action#readme",
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/github": "^6",
Expand All @@ -63,7 +56,6 @@
"eslint-plugin-jest": "^27",
"eslint-plugin-prettier": "^5",
"npm-run-all": "^4.1.5",
"pkg": "^5.8.0",
"prettier": "^3",
"ts-jest": "^29"
},
Expand Down

0 comments on commit 2d23182

Please sign in to comment.