Skip to content

Commit

Permalink
ci: use github actions instead of travis
Browse files Browse the repository at this point in the history
  • Loading branch information
Neonox31 committed Oct 6, 2023
1 parent 8b2058c commit 82045a4
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/angular.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
on:
workflow_call:

env:
NODE_JS_VERSION: 12

jobs:
install-and-scan-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{env.NODE_JS_VERSION}}
cache: 'yarn'
- uses: actions/cache@v3
with:
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
path: '**/node_modules'
- run: yarn config get cacheFolder
- run: yarn --frozen-lockfile
- run: yarn run improved-yarn-audit --min-severity high || true

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{env.NODE_JS_VERSION}}
cache: 'yarn'
- uses: actions/cache@v3
with:
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
path: '**/node_modules'
- run: yarn config get cacheFolder
- run: yarn --frozen-lockfile
- run: yarn lint
needs:
- install-and-scan-deps

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{env.NODE_JS_VERSION}}
cache: 'yarn'
- uses: actions/cache@v3
with:
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
path: '**/node_modules'
- run: yarn --frozen-lockfile
- run: yarn build:lib --prod
- run: yarn build:demo --base-href "/ngx-openlayers/" --progress false
- uses: actions/upload-artifact@v3
with:
name: build
path: dist/
needs:
- install-and-scan-deps
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
on:
push:
tags:
- '*'

jobs:
angular:
uses: ./.github/workflows/angular.yml
release-on-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: build
path: dist
- uses: actions/setup-node@v3
with:
node-version: ${{env.NODE_JS_VERSION}}
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
- uses: actions/cache@v3
with:
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
path: '**/node_modules'
- run: cp projects/ngx-openlayers/CHANGELOG.md dist/ngx-openlayers/CHANGELOG.md
- run: cd dist/ngx-openlayers/ && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
needs:
- angular
8 changes: 8 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
on:
push:
tags-ignore:
- '**'

jobs:
angular:
uses: ./.github/workflows/angular.yml
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"improved-yarn-audit": "^3.0.0",
"jasmine-core": "~3.8.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5279,6 +5279,11 @@ import-local@^2.0.0:
pkg-dir "^3.0.0"
resolve-cwd "^2.0.0"

improved-yarn-audit@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/improved-yarn-audit/-/improved-yarn-audit-3.0.0.tgz#dfb09cea1a3a92c790ea2b4056431f6fb1b99bfa"
integrity sha512-b7CrBYYwMidtPciCBkW62C7vqGjAV10bxcAWHeJvGrltrcMSEnG5I9CQgi14nmAlUKUQiSvpz47Lo3d7Z3Vjcg==

imurmurhash@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
Expand Down

0 comments on commit 82045a4

Please sign in to comment.