Skip to content

Commit a079a1c

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

File tree

9 files changed

+1389
-1309
lines changed

9 files changed

+1389
-1309
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
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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
on:
2+
push:
3+
branches:
4+
- '**'
5+
tags-ignore:
6+
- '**'
7+
8+
jobs:
9+
angular:
10+
uses: ./.github/workflows/angular.yml

.github/workflows/tags.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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 --tag next
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+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
runs-on: ubuntu-latest
61+
permissions:
62+
contents: read
63+
pages: write
64+
id-token: write
65+
steps:
66+
- uses: actions/download-artifact@v3
67+
with:
68+
name: demo-build
69+
path: .
70+
- uses: actions/upload-pages-artifact@v2
71+
with:
72+
path: .
73+
- uses: actions/deploy-pages@v2
74+
id: deployment
75+
needs:
76+
- angular

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://registry.yarnpkg.com

.travis.yml

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

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@
4343
"@types/node": "^12.11.1",
4444
"@typescript-eslint/eslint-plugin": "^5.36.2",
4545
"@typescript-eslint/parser": "^5.36.2",
46+
"commit-and-tag-version": "^12.0.0",
4647
"eslint": "^8.23.0",
4748
"eslint-plugin-import": "latest",
4849
"eslint-plugin-jsdoc": "latest",
4950
"eslint-plugin-prefer-arrow": "latest",
51+
"improved-yarn-audit": "^3.0.0",
5052
"jasmine-core": "~4.3.0",
5153
"jasmine-spec-reporter": "~5.0.0",
5254
"karma": "~6.4.1",
@@ -57,8 +59,10 @@
5759
"ng-packagr": "^14.2.2",
5860
"prettier": "^2.0.3",
5961
"protractor": "~7.0.0",
60-
"standard-version": "^7.1.0",
6162
"ts-node": "~8.3.0",
6263
"typescript": "~4.7.2"
64+
},
65+
"volta": {
66+
"node": "16.20.2"
6367
}
6468
}

projects/ngx-openlayers/CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# Change Log
1+
# Changelog
22

3-
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
3+
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4+
5+
## [1.0.0-next.20](https://github.com/quentin-ol/ngx-openlayers/compare/1.0.0-next.19...1.0.0-next.20) (2023-11-30)
46

57
<a name="1.0.0-next.19"></a>
68
# [1.0.0-next.19](https://github.com/quentin-ol/ngx-openlayers/compare/1.0.0-next.17...1.0.0-next.19) (2021-09-03)

projects/ngx-openlayers/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
"name": "ngx-openlayers",
33
"version": "1.0.0-next.19",
44
"scripts": {
5-
"release": "standard-version -m \"chore(release): version %s\" -t \"\" --prerelease next"
6-
},
7-
"standard-version": {
8-
"postchangelog": "cp projects/ngx-openlayers/CHANGELOG.md dist/ngx-openlayers/CHANGELOG.md"
5+
"release": "commit-and-tag-version -m \"chore(release): version %s\" -t \"\" --prerelease next"
96
},
107
"peerDependencies": {
118
"@angular/common": ">=6.0.0 <=14.x.x",

0 commit comments

Comments
 (0)