Skip to content

Commit ab0c0eb

Browse files
committed
ci: restoring the deployment script
Signed-off-by: Pawel Psztyc <[email protected]>
1 parent 0e08a4b commit ab0c0eb

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed

.github/workflows/deployment.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Tests and publishing
2+
env:
3+
FORCE_COLOR: 1
4+
on:
5+
push:
6+
branches:
7+
- master
8+
- main
9+
- develop
10+
pull_request:
11+
branches:
12+
- master
13+
- main
14+
jobs:
15+
test_linux:
16+
name: Ubuntu
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
- uses: actions/setup-node@v1
21+
with:
22+
node-version: 14
23+
- uses: microsoft/playwright-github-action@v1
24+
- uses: actions/cache@v1
25+
with:
26+
path: ~/.npm
27+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
28+
restore-keys: |
29+
${{ runner.os }}-node-
30+
- name: Install dependencies
31+
run: npm ci
32+
- name: Run tests
33+
run: npm test
34+
test_win:
35+
name: "Windows"
36+
runs-on: windows-latest
37+
steps:
38+
- uses: actions/checkout@v2
39+
- uses: actions/setup-node@v1
40+
with:
41+
node-version: 14
42+
- uses: microsoft/playwright-github-action@v1
43+
- uses: actions/cache@v1
44+
with:
45+
path: ~/.npm
46+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
47+
restore-keys: |
48+
${{ runner.os }}-node-
49+
- name: Install dependencies
50+
run: npm ci
51+
- name: Run tests
52+
run: npm test
53+
tag:
54+
name: "Publishing release"
55+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
56+
needs:
57+
- test_linux
58+
- test_win
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Checkout code
62+
uses: actions/checkout@v2
63+
with:
64+
fetch-depth: 0
65+
- uses: actions/setup-node@v2
66+
with:
67+
node-version: '14.x'
68+
registry-url: 'https://registry.npmjs.org'
69+
- uses: actions/cache@v1
70+
with:
71+
path: ~/.npm
72+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
73+
restore-keys: |
74+
${{ runner.os }}-node-
75+
- run: npm install
76+
- name: Read version from package.json
77+
uses: culshaw/read-package-node-version-actions@v1
78+
id: package-node-version
79+
- name: Changelog
80+
uses: scottbrenner/generate-changelog-action@master
81+
id: Changelog
82+
- name: Github Release
83+
id: create_release
84+
uses: actions/create-release@latest
85+
env:
86+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
with:
88+
tag_name: v${{ steps.package-node-version.outputs.version }}
89+
release_name: v${{ steps.package-node-version.outputs.version }}
90+
body: |
91+
${{ steps.Changelog.outputs.changelog }}
92+
draft: false
93+
prerelease: false
94+
- run: npm publish --access public
95+
env:
96+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)