Skip to content

Commit 4ef4752

Browse files
authored
Merge pull request #1 from sslava/workflows
(feat): workflows
2 parents 43d5151 + e2aac86 commit 4ef4752

File tree

4 files changed

+122
-29
lines changed

4 files changed

+122
-29
lines changed

.github/dependabot.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: ".github/workflows"
5+
schedule:
6+
interval: "monthly"
7+
commit-message:
8+
# Prefix all commit messages with "chore: "
9+
prefix: "chore"
10+
open-pull-requests-limit: 10
11+
12+
- package-ecosystem: "npm"
13+
directory: "/"
14+
commit-message:
15+
# Prefix all commit messages with "chore: "
16+
prefix: "chore"
17+
schedule:
18+
interval: "weekly"
19+
open-pull-requests-limit: 10
20+
groups:
21+
# Production dependencies without breaking changes
22+
dependencies:
23+
dependency-type: "production"
24+
update-types:
25+
- "minor"
26+
- "patch"
27+
# Production dependencies with breaking changes
28+
dependencies-major:
29+
dependency-type: "production"
30+
update-types:
31+
- "major"
32+
# Development dependencies
33+
dev-dependencies:
34+
dependency-type: "development"

.github/release.yml

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

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
2+
name: CI
3+
4+
on: [push, pull_request]
5+
6+
jobs:
7+
test:
8+
strategy:
9+
matrix:
10+
node: ["22.0.0"]
11+
platform: [ubuntu-latest]
12+
name: Node v${{matrix.node}} ((${{matrix.platform}}))
13+
runs-on: ${{matrix.platform}}
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: ${{matrix.node}}
19+
- name: install dependencies
20+
run: npm ci
21+
- name: lint code
22+
run: npm run lint
23+
- name: build project
24+
run: npm run build
25+
- name: run tests
26+
run: npm run test
27+
- name: coverage
28+
uses: codecov/codecov-action@v4
29+
if: github.actor != 'dependabot[bot]'
30+
with:
31+
fail_ci_if_error: true
32+
verbose: false
33+
token: ${{ secrets.CODECOV_TOKEN }}
34+
env:
35+
CI: true
36+
37+
release-preview:
38+
runs-on: ubuntu-latest
39+
needs: test
40+
steps:
41+
- uses: actions/checkout@v4
42+
- uses: actions/setup-node@v4
43+
with:
44+
node-version: "22.0.0"
45+
- name: install dependencies
46+
run: npm ci
47+
- name: build project
48+
run: npm run build
49+
- name: release preview with pkr-pr-new
50+
run: npx pkg-pr-new publish

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
release:
12+
permissions:
13+
contents: write # to create release (changesets/action)
14+
issues: write # to post issue comments (changesets/action)
15+
pull-requests: write # to create pull request (changesets/action)
16+
id-token: write # to create release (changesets/action)
17+
packages: write # to publish to npm (changesets/action)
18+
timeout-minutes: 20
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 20.x
25+
- name: install dependencies
26+
run: npm ci
27+
- name: build project
28+
run: npm run build
29+
- name: Create Release Pull Request or Publish to npm
30+
uses: changesets/action@v1
31+
with:
32+
publish: npm run release
33+
version: npm run version
34+
commit: "chore: new release"
35+
title: "chore: new release candidate"
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)