Skip to content

Commit 327e6f5

Browse files
authored
ci: add release drafter (#545)
1 parent 0626bf8 commit 327e6f5

File tree

4 files changed

+68
-1
lines changed

4 files changed

+68
-1
lines changed

.github/release-drafter.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name-template: 'v$RESOLVED_VERSION 🌈'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
version-resolver:
4+
major:
5+
labels:
6+
- major
7+
minor:
8+
labels:
9+
- minor
10+
patch:
11+
labels:
12+
- patch
13+
default: patch
14+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
15+
change-title-escapes: '\<*_&'
16+
template: |
17+
## Changes
18+
19+
$CHANGES
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 📝 Draft or update next release
2+
concurrency: draft_or_update_next_release
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
10+
jobs:
11+
prepare-deployment:
12+
name: 📝 Draft or update next release
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 30
15+
steps:
16+
- uses: actions/checkout@v1
17+
18+
- uses: release-drafter/release-drafter@v5
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release
2+
3+
on:
4+
# This job runs when a new release is published
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-node@v2
14+
with:
15+
node-version: 16
16+
registry-url: https://registry.npmjs.org
17+
- uses: actions/cache@v2
18+
with:
19+
path: ~/.npm
20+
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
21+
# Store the name of the release
22+
# See https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
23+
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
24+
- run: npm ci
25+
- run: npm version $RELEASE_VERSION --no-git-tag-version
26+
- run: npm run build
27+
- run: npm publish --access public
28+
env:
29+
NODE_AUTH_TOKEN: ${{ secrets.BOWSER_NPM_PUBLISH_TOKEN }}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "bowser",
3-
"version": "2.11.0",
43
"description": "Lightweight browser detector",
54
"keywords": [
65
"browser",

0 commit comments

Comments
 (0)