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

ci: automatic releases #166

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '14'
node-version: 18
Copy link
Contributor

@ChALkeR ChALkeR Feb 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's file a separate PR for this (and bump that to 20)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's either this or running yarn install with --ignore-engines. I prefer the node version update

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to 20

Copy link
Contributor Author

@sparten11740 sparten11740 Feb 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are actually getting test failures here in node 20, reverted back to 18

- run: yarn --frozen-lockfile
- run: git submodule update --init --recursive
- run: yarn run coverage:lcov
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: yarn --frozen-lockfile
- run: yarn --frozen-lockfile --ignore-engines
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are installing dev dependencies here as well and semantic-release requires node >= 18, so this is required to silence yarn about the engine mismatch

- run: yarn lint
- run: git submodule update --init --recursive
- run: yarn run test
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release
on:
push:
branches:
- master
Copy link
Contributor

@ChALkeR ChALkeR Feb 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above comments
perhaps we should create a more protected release branch and publish from it? Making releases separate prs to the release branch and require them to have more than 2 reviews


jobs:
publish:
environment: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: yarn semantic-release
20 changes: 20 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"branches": ["master"],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits"
}
],
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/github"
]
}
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,22 @@
"lint": "prettier --list-different '**/*.js' && eslint .",
"format": "prettier --write '**/*.js'",
"coverage": "c8 --reporter=lcov --reporter=text npm run test",
"coverage:lcov": "c8 --reporter=lcovonly npm run test",
"coverage:lcov": "c8 --reporter=lcovonly yarn test",
"test:only:json-schema-testsuite": "tape test/json-schema.js | tap-spec",
"test": "npm run test:raw | tap-spec",
"test:raw": "npm run test:normal && npm run test:module",
"test": "yarn test:raw | tap-spec",
"test:raw": "yarn test:normal && yarn test:module",
"test:module": "tape -r ./test/tools/test-module.js test/*.js test/regressions/*.js",
"test:normal": "tape test/*.js test/regressions/*.js",
"release": "semantic-release",
"test:normal": "tape test/*.js test/regressions/*.js",
"test:types": "yarn --cwd test/types test"
},
"dependencies": {},
"devDependencies": {
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/github": "^9.2.3",
"c8": "^7.9.0",
"conventional-changelog-conventionalcommits": "^6.0.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^3.1.0",
"eslint-config-standard": "^16.0.3",
Expand All @@ -50,6 +55,7 @@
"eslint-plugin-promise": "^5.1.0",
"prettier": "~1.14.3",
"safe-regex": "^1.1.0",
"semantic-release": "^21.1.1",
"tap-spec": "^5.0.0",
"tape": "^5.3.1"
},
Expand Down
Loading
Loading