Skip to content

Commit ef8f97b

Browse files
authored
ci: release as github actions (#162)
* ci: release as github actions * fix: tag version * ci: update release management * fix: docs
1 parent 9286f36 commit ef8f97b

File tree

9 files changed

+102
-291
lines changed

9 files changed

+102
-291
lines changed

.github/CONTRIBUTING.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/version.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,42 @@ on:
77
description: 'Version to increment (major, minor or patch)'
88
required: true
99
default: 'patch'
10-
10+
permissions:
11+
contents: write
1112
jobs:
12-
npm:
13+
version:
1314
runs-on: ubuntu-latest
1415
env:
1516
VERSION: ${{ github.event.inputs.version }}
17+
outputs:
18+
tag: ${{ steps.get-tag.outputs.TAG }}
1619
steps:
1720
- run: |
1821
if [[ "$VERSION" != "major" ]] && [[ "$VERSION" != "minor" ]] && [[ "$VERSION" != "patch" ]]; then
1922
echo "Input should be either 'major', 'minor' or 'patch'"
2023
exit 1
2124
fi
2225
- run: |
23-
git config --global user.name "${{ secrets.GIT_USER_NAME }}"
24-
git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
26+
git config --global user.name "github-actions[bot]"
27+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
2528
- uses: actions/checkout@v4
2629
with:
2730
fetch-depth: 0
2831
- uses: actions/[email protected]
2932
with:
3033
node-version-file: package.json
34+
registry-url: "https://registry.npmjs.org"
3135
- run: npm ci
32-
- run: npm version $VERSION
33-
- name: NPM Publish
34-
uses: JS-DevTools/npm-publish@v3
35-
with:
36-
token: ${{ secrets.NPM_TOKEN }}
37-
- run: |
38-
echo "TAG=$(npm run env | grep npm_package_version | cut -d '=' -f 2)" >> $GITHUB_ENV
36+
- run: npm run check
37+
- run: npm version $VERSION --no-git-tag-version
38+
- id: get-tag
39+
run: |
40+
echo "TAG=$(jq -r '.version' < package.json)" >> $GITHUB_OUTPUT
3941
- name: Create Github Release
40-
uses: actions/create-release@v1
4142
env:
42-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43-
with:
44-
tag_name: refs/tags/${{ env.TAG }}
45-
release_name: Version ${{ env.TAG }}
46-
body: Version ${{ env.TAG }}
47-
43+
GH_TOKEN: ${{ github.token }}
44+
run: |
45+
gh release create "${{ steps.get-tag.outputs.TAG }}" --title "Version ${{ needs.version.outputs.TAG }}" --generate-notes --target "${{ github.ref }}"
46+
- run: npm publish
47+
env:
48+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.npmrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
tag-version-prefix=""
1+
tag-version-prefix=
2+
git-tag-version=false

CHANGELOG.md

Lines changed: 0 additions & 254 deletions
This file was deleted.
File renamed without changes.

CONTRIBUTING.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributing
2+
3+
When contributing to this repository, please first discuss the change you wish to make via issue before making a change.
4+
5+
Please note we have a [code of conduct](/CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.
6+
7+
## Development Setup
8+
9+
1. Fork and clone the repository
10+
2. Install dependencies:
11+
```bash
12+
npm install
13+
```
14+
3. Build the project:
15+
```bash
16+
npm run build
17+
```
18+
19+
## Testing
20+
21+
Run the test suite before submitting any changes:
22+
23+
```bash
24+
npm test
25+
```
26+
27+
The project uses Jest for testing. You can find test files in the `test/` directory.
28+
29+
## Commit Message Guidelines
30+
31+
Please follow these guidelines for commit messages:
32+
33+
- Use the present tense ("Add feature" not "Added feature")
34+
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
35+
- Limit the first line to 72 characters or less
36+
- Reference issues and pull requests liberally after the first line
37+
38+
## Pull Request Process
39+
40+
1. Ensure your code passes on all tests/checks.
41+
2. Update the README.md with details of changes to the API interface.
42+
3. Only admins will merge the Pull Request.
43+
44+
## Release Process
45+
46+
Releases are managed by project maintainers and follow semantic versioning (MAJOR.MINOR.PATCH).

0 commit comments

Comments
 (0)