Skip to content

Commit

Permalink
ci: use Git Actions for build and release, deprecate Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
JeB committed Dec 28, 2023
1 parent fca425c commit 9a36b36
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 20 deletions.
9 changes: 0 additions & 9 deletions .dependabot/config.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
## PR Checklist

Please check if your PR fulfills the following requirements:

- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)

## PR Type

What kind of change does this PR introduce?

<!-- Please check the one that applies to this PR using "x". -->

```
[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:
```

## What is the current behavior?

<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->

Issue Number: N/A

## What is the new behavior?

## Does this PR introduce a breaking change?

```
[ ] Yes
[ ] No
```

<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->

## Other information
2 changes: 1 addition & 1 deletion .github/autoapproval.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from_owner:
- just-jeb
- dependabot-preview[bot]
- renovate[bot]
apply_labels:
- autoapproved
required_labels: []
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: build

on:
push:
branches:
- master
pull_request:

jobs:
build:
if: (!contains(github.event.head_commit.message, 'chore(release)'))
runs-on: ubuntu-latest
strategy:
fail-fast: true

steps:
uses: actions/checkout@v4

- uses: actions/cache@v3
id: npm-cache
with:
path: ~/.npm # Default cache directory for npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Run build and tests
run: npm run build
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: release

on:
workflow_dispatch:

jobs:
build_and_release:
runs-on: ubuntu-latest
strategy:
fail-fast: true

steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PERSONAL_TOKEN }}
fetch-depth: 0

- uses: actions/cache@v3
id: npm-cache
with:
path: ~/.npm # Default cache directory for npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Release to NPM
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
git reset --hard
git config --global user.name ${{ secrets.GIT_USER }}
git config --global user.email ${{ secrets.GIT_EMAIL }}
npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
npm run release
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Evgeny Barabanov",
"license": "MIT",
"engines": {
"node": ">=6.11.5"
"node": ">=18"
},
"keywords": [
"jest",
Expand Down

0 comments on commit 9a36b36

Please sign in to comment.