Skip to content

Commit baa290a

Browse files
Prepared git actions for publishing a package release
1 parent f2dfbfd commit baa290a

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish release
2+
3+
on:
4+
push:
5+
branches: [ release ]
6+
7+
jobs:
8+
publish:
9+
name: Publish
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout the repository
13+
uses: actions/checkout@v3
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: lts/*
17+
registry-url: https://registry.npmjs.org/
18+
- name: Install dependencies
19+
run: npm ci
20+
- name: Publish package to NPM
21+
run: npm publish
22+
env:
23+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
24+
- name: Build package to upload to GitHub releases
25+
run: |
26+
npm pack
27+
mv @acpr/rate-limit-postgresql-*.tgz @acpr/rate-limit-postgresql.tgz
28+
- name: Create a Github release
29+
uses: softprops/action-gh-release@v1
30+
with:
31+
files: @acpr/rate-limit-postgresql.tgz
32+
body:
33+
You can view the changelog
34+
[here](https://github.com/adrianprelipcean/express-rate-limit-postgresql/blob/master/changelog.md).

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [ master ]
66
pull_request:
7-
branches: [ master ]
7+
branches: [ master, release ]
88

99
jobs:
1010
build:

0 commit comments

Comments
 (0)