Skip to content

Commit 294d470

Browse files
committed
ci: switch from travis to github actions
1 parent 2eced8b commit 294d470

File tree

6 files changed

+155
-75
lines changed

6 files changed

+155
-75
lines changed

.github/workflows/angular.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
on:
2+
workflow_call:
3+
4+
env:
5+
NODE_JS_VERSION: 16
6+
7+
jobs:
8+
install-and-scan-deps:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-node@v3
13+
with:
14+
node-version: ${{env.NODE_JS_VERSION}}
15+
cache: 'yarn'
16+
- uses: actions/cache@v3
17+
with:
18+
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
19+
path: '**/node_modules'
20+
- run: yarn config get cacheFolder
21+
- run: yarn --frozen-lockfile
22+
- run: yarn run improved-yarn-audit --min-severity high || true
23+
24+
lint:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: actions/setup-node@v3
29+
with:
30+
node-version: ${{env.NODE_JS_VERSION}}
31+
cache: 'yarn'
32+
- uses: actions/cache@v3
33+
with:
34+
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
35+
path: '**/node_modules'
36+
- run: yarn config get cacheFolder
37+
- run: yarn --frozen-lockfile
38+
- run: yarn lint
39+
needs:
40+
- install-and-scan-deps
41+
42+
build:
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v4
46+
- uses: actions/setup-node@v3
47+
with:
48+
node-version: ${{env.NODE_JS_VERSION}}
49+
cache: 'yarn'
50+
- uses: actions/cache@v3
51+
with:
52+
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
53+
path: '**/node_modules'
54+
- run: yarn --frozen-lockfile
55+
- run: yarn build:lib
56+
- run: yarn build:demo --base-href "/ngx-openlayers/" --progress false
57+
- uses: actions/upload-artifact@v3
58+
with:
59+
name: lib-build
60+
path: dist/ngx-openlayers/
61+
- uses: actions/upload-artifact@v3
62+
with:
63+
name: demo-build
64+
path: dist/demo-ngx-openlayers/
65+
needs:
66+
- install-and-scan-deps

.github/workflows/main.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
on:
2+
push:
3+
tags-ignore:
4+
- '**'
5+
6+
jobs:
7+
angular:
8+
uses: ./.github/workflows/angular.yml

.github/workflows/tags.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
on:
2+
push:
3+
tags:
4+
- '*'
5+
6+
jobs:
7+
angular:
8+
uses: ./.github/workflows/angular.yml
9+
10+
release-lib-on-npm:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/download-artifact@v3
15+
with:
16+
name: lib-build
17+
path: dist/ngx-openlayers/
18+
- uses: actions/setup-node@v3
19+
with:
20+
node-version: ${{env.NODE_JS_VERSION}}
21+
cache: 'yarn'
22+
registry-url: 'https://registry.npmjs.org'
23+
- uses: actions/cache@v3
24+
with:
25+
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
26+
path: '**/node_modules'
27+
- run: cp projects/ngx-openlayers/CHANGELOG.md dist/ngx-openlayers/CHANGELOG.md
28+
- run: cd dist/ngx-openlayers/ && npm publish
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
31+
needs:
32+
- angular
33+
34+
release-lib-on-gh:
35+
runs-on: ubuntu-latest
36+
permissions:
37+
contents: write
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: actions/download-artifact@v3
41+
with:
42+
name: lib-build
43+
path: dist/ngx-openlayers/
44+
- id: check-tag
45+
run: |
46+
if echo "${{ github.event.ref }}" | grep -Eq "^refs/tags/[0-9]+.[0-9]+.[0-9]+-.*$"; then
47+
echo "prerelease=true" >> $GITHUB_OUTPUT
48+
fi
49+
- uses: ncipollo/release-action@v1
50+
with:
51+
artifacts: "dist/ngx-openlayers/"
52+
prerelease: ${{ steps.check-tag.outputs.prerelease == 'true' }}
53+
needs:
54+
- angular
55+
56+
deploy-demo-on-gh-pages:
57+
runs-on: ubuntu-latest
58+
permissions:
59+
contents: read
60+
pages: write
61+
id-token: write
62+
steps:
63+
- uses: actions/download-artifact@v3
64+
with:
65+
name: demo-build
66+
path: .
67+
- uses: actions/upload-pages-artifact@v2
68+
with:
69+
path: .
70+
- uses: actions/deploy-pages@v2
71+
with:
72+
name: demo-build
73+
path: dist/demo-ngx-openlayers/
74+
needs:
75+
- angular

.travis.yml

Lines changed: 0 additions & 75 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"eslint-plugin-import": "latest",
4848
"eslint-plugin-jsdoc": "latest",
4949
"eslint-plugin-prefer-arrow": "latest",
50+
"improved-yarn-audit": "^3.0.0",
5051
"jasmine-core": "~4.3.0",
5152
"jasmine-spec-reporter": "~5.0.0",
5253
"karma": "~6.4.1",

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5351,6 +5351,11 @@ import-fresh@^3.0.0, import-fresh@^3.2.1:
53515351
parent-module "^1.0.0"
53525352
resolve-from "^4.0.0"
53535353

5354+
improved-yarn-audit@^3.0.0:
5355+
version "3.0.0"
5356+
resolved "https://registry.yarnpkg.com/improved-yarn-audit/-/improved-yarn-audit-3.0.0.tgz#dfb09cea1a3a92c790ea2b4056431f6fb1b99bfa"
5357+
integrity sha512-b7CrBYYwMidtPciCBkW62C7vqGjAV10bxcAWHeJvGrltrcMSEnG5I9CQgi14nmAlUKUQiSvpz47Lo3d7Z3Vjcg==
5358+
53545359
imurmurhash@^0.1.4:
53555360
version "0.1.4"
53565361
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"

0 commit comments

Comments
 (0)