Skip to content

Commit 20aab3f

Browse files
committed
build: add release workflow
1 parent a01b6d5 commit 20aab3f

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.github/workflows/release.yaml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Setup NodeJS
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: 20
17+
- name: Restore/create node_modules cache
18+
uses: actions/cache@v4
19+
with:
20+
path: '**/node_modules'
21+
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}
22+
- name: Install
23+
run: npm install
24+
- name: Tag
25+
run: |
26+
git config user.name "GitHub action"
27+
git config user.email "[email protected]"
28+
npm run release
29+
git push --follow-tags origin master
30+
- name: version
31+
run: echo "::set-output name=version::$(node -e "console.log(require('./package.json').version);")"
32+
id: version
33+
- name: release
34+
uses: actions/create-release@v1
35+
with:
36+
draft: false
37+
prerelease: false
38+
release_name: ${{ steps.version.outputs.version }}
39+
tag_name: ${{ steps.version.outputs.version }}
40+
body_path: CHANGELOG.md
41+
env:
42+
GITHUB_TOKEN: ${{ github.token }}

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
"REST",
1212
"api.ovh.com"
1313
],
14+
"files": [
15+
"lib"
16+
],
1417
"main": "./lib/ovh.es5.js",
1518
"repository": {
1619
"type": "git",

0 commit comments

Comments
 (0)