Skip to content

Commit

Permalink
Polish workflows (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasturrell authored May 25, 2023
1 parent 06777bc commit 2bfbe18
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 139 deletions.
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ updates:
versioning-strategy: lockfile-only
schedule:
interval: "weekly"
open-pull-requests-limit: 5
42 changes: 0 additions & 42 deletions .github/workflows/main.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16, 18]
# see supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npx ng build
# TODO add linting
- run: npx ng test --no-watch --no-progress --browsers=ChromeHeadless
36 changes: 36 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npx ng build
- run: npx ng test --no-watch --no-progress --browsers=ChromeHeadless

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: |
cd dist/ngx-unsplash/
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
51 changes: 0 additions & 51 deletions .github/workflows/publish.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/pull_request.yml

This file was deleted.

6 changes: 3 additions & 3 deletions projects/ngx-unsplash/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@berry-cloud/ngx-unsplash",
"private": false,
"version": "3.0.0",
"version": "2.0.2",
"description": "Lightweight Angular wrapper for the Unsplash API.",
"repository": {
"type": "git",
Expand All @@ -17,7 +17,7 @@
},
"homepage": "https://github.com/BerryCloud/ngx-unsplash#readme",
"scripts": {
"preversion": "ng build && ng test --no-watch --no-progress --browsers=ChromeHeadlessCI",
"preversion": "ng build && ng test --no-watch --no-progress --browsers=ChromeHeadless",
"version": "git add . && git commit -m \"Version $npm_package_version\" && git tag v$npm_package_version",
"postversion": "git push && git push --tags"
},
Expand All @@ -32,5 +32,5 @@
"devDependencies": {
"blurhash": "^2.0.5"
},
"sideEffects": false
"sideEffects": false
}

0 comments on commit 2bfbe18

Please sign in to comment.