Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add license #38

Merged
merged 7 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/actions/branch-exists/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
description: 'branch to check existence for'
required: true
outputs:
exists:
exists:
description: "Boolean of whether branch exists"
value: ${{ steps.branch.outputs.exists }}
runs:
Expand All @@ -22,7 +22,7 @@ runs:
shell: bash
run: |
if [ -z $(git show-ref -- heads/$branch) ]; then
echo ::set-output name=exists::false
echo "exists=false" >> $GITHUB_OUTPUT
else
echo ::set-output name=exists::true
echo "exists=true" >> $GITHUB_OUTPUT
fi
4 changes: 2 additions & 2 deletions .github/actions/cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ runs:
using: "composite"
steps:
- name: Cache dependencies
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
cache: ${{ env.node-package-manager }}
cache: ${{ env.node-package-manager }}
6 changes: 3 additions & 3 deletions .github/actions/check-secret/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
description: 'Secret to check'
required: true
outputs:
defined:
defined:
description: "Boolean of whether secret is defined"
value: ${{ steps.secret.outputs.defined }}
runs:
Expand All @@ -18,7 +18,7 @@ runs:
shell: bash
run: |
if [ "$secret" == "" ]; then
echo ::set-output name=defined::false
echo "defined=false" >> $GITHUB_OUTPUT
else
echo ::set-output name=defined::true
echo "defined=true" >> $GITHUB_OUTPUT
fi
20 changes: 10 additions & 10 deletions .github/workflows/node-ci.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ on:
- "!main"
tags:
- "**"
- "!v*"
- "!v*"

jobs:
cache-dependencies:
runs-on: ubuntu-latest
steps:
- name: Access repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: ./.github/actions/cache
- name: Install dependencies
run: yarn install --frozen-lockfile
Expand All @@ -29,14 +29,14 @@ jobs:
needs: cache-dependencies
steps:
- name: Access repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: ./.github/actions/test

validate-dependencies:
runs-on: ubuntu-latest
steps:
- name: Access repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: ./.github/actions/validate-dependencies

build:
Expand All @@ -46,7 +46,7 @@ jobs:
- validate-dependencies
steps:
- name: Access repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: ./.github/actions/cache

- name: Install dependencies
Expand All @@ -56,7 +56,7 @@ jobs:
run: yarn build

- name: Upload build artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}-develop
path: dist
Expand All @@ -68,7 +68,7 @@ jobs:
defined: ${{ steps.username.outputs.defined == 'true' && steps.password.outputs.defined == 'true' }}
steps:
- name: Access repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Check if has username
id: username
Expand All @@ -89,16 +89,16 @@ jobs:
- check-docker-credentials
steps:
- name: Access repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: get version
id: version
uses: notiz-dev/github-action-json-property@release
with:
with:
path: 'package.json'
prop_path: 'version'

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: ${{ github.event.repository.name }}-develop
path: dist
Expand Down
45 changes: 25 additions & 20 deletions .github/workflows/node-ci.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# The destination is only triggered if the secret 'NPM_TOKEN' is provided.
#
# [Docker Hub]
# The destination is only triggered if the secrets 'DOCKER_USERNAME' and 'DOCKER_PASSWORD' are
# The destination is only triggered if the secrets 'DOCKER_USERNAME' and 'DOCKER_PASSWORD' are
# provided.
#
#######################################################################################################################
Expand All @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Access repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: ./.github/actions/cache
- name: Install dependencies
run: yarn install --frozen-lockfile
Expand All @@ -44,7 +44,7 @@ jobs:
needs: cache-dependencies
steps:
- name: Access repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: ./.github/actions/cache
- name: Install dependencies
run: yarn install --frozen-lockfile
Expand All @@ -56,15 +56,15 @@ jobs:
needs: cache-dependencies
steps:
- name: Access repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- uses: ./.github/actions/test

validate-dependencies:
runs-on: ubuntu-latest
steps:
- name: Access repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: ./.github/actions/validate-dependencies

bump-version:
Expand All @@ -80,7 +80,7 @@ jobs:
bumped: ${{ steps.tag_version.outputs.new_tag != '' }}
steps:
- name: Access repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Configure committer
run: |
git config user.name "${{ github.event.pusher.name }}"
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
- bump-version
steps:
- name: Access repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Pull request to develop
id: develop
continue-on-error: true
Expand All @@ -140,7 +140,7 @@ jobs:
- bump-version
steps:
- name: Access repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Ensure commits from bump-version
run: git pull
- uses: ./.github/actions/cache
Expand All @@ -149,7 +149,7 @@ jobs:
- name: Build
run: yarn build
- name: Upload build artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}
path: dist
Expand All @@ -161,7 +161,7 @@ jobs:
defined: ${{ steps.release.outputs.defined == 'true' }}
steps:
- name: Access repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Check if is set to release
id: release
uses: ./.github/actions/check-secret
Expand All @@ -176,9 +176,9 @@ jobs:
- check-github-release
steps:
- name: Access repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: ${{ github.event.repository.name }}
path: dist
Expand Down Expand Up @@ -213,7 +213,7 @@ jobs:
defined: ${{ steps.token.outputs.defined == 'true' }}
steps:
- name: Access repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Check if has username
id: token
uses: ./.github/actions/check-secret
Expand All @@ -228,22 +228,27 @@ jobs:
- check-npm-token
steps:
- name: Access repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Configure publisher
run: |
git config user.name "${{ github.event.pusher.name }}"
git config user.email "${{ github.event.pusher.email }}"
- name: Download artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: ${{ github.event.repository.name }}
path: dist
- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
- name: Ensure that Yarn V3 dependencies are installed
run: yarn install
shell: bash
- name: Set package.json version
run: yarn version "${{ needs.bump-version.outputs.version }}"
- name: Publish package
run: yarn publish --access=public --tag latest --new-version "${{ needs.bump-version.outputs.version }}"
run: yarn npm publish --access=public --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand All @@ -254,7 +259,7 @@ jobs:
defined: ${{ steps.username.outputs.defined == 'true' && steps.password.outputs.defined == 'true' }}
steps:
- name: Access repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Check if has username
id: username
uses: ./.github/actions/check-secret
Expand All @@ -274,9 +279,9 @@ jobs:
- check-docker-credentials
steps:
- name: Access repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: ${{ github.event.repository.name }}
path: dist
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 TV 2 Danmark

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@tv2media/logger",
"version": "1.2.4",
"version": "2.0.0",
"license": "MIT",
"main": "dist/cjs/index.js",
"types": "dist/cjs/index.d.ts",
"exports": {
Expand Down