From 435ea04edc4e021e8f243d6d674504df5d1459a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Frederik=20J=C3=B8rgensen?= Date: Fri, 10 Mar 2023 10:40:32 +0100 Subject: [PATCH 1/5] chore: NPM publish needed to running yarn install. --- .github/workflows/node-ci.prod.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/node-ci.prod.yml b/.github/workflows/node-ci.prod.yml index 57c371e..5146561 100644 --- a/.github/workflows/node-ci.prod.yml +++ b/.github/workflows/node-ci.prod.yml @@ -242,6 +242,9 @@ jobs: 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: Publish package run: yarn publish --access=public --tag latest --new-version "${{ needs.bump-version.outputs.version }}" env: From 150d026f06a731f20bd941eb2ca6a17fb49a470b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Frederik=20J=C3=B8rgensen?= Date: Mon, 3 Apr 2023 08:02:49 +0200 Subject: [PATCH 2/5] chore: Added MIT license. --- LICENSE | 21 +++++++++++++++++++++ package.json | 1 + 2 files changed, 22 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b4fad67 --- /dev/null +++ b/LICENSE @@ -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. diff --git a/package.json b/package.json index f5f327e..e7e983b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "@tv2media/logger", "version": "1.2.4", + "license": "MIT", "main": "dist/cjs/index.js", "types": "dist/cjs/index.d.ts", "exports": { From 9cc32375e1d08dd816e8560283b0d66cfff1248b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Frederik=20J=C3=B8rgensen?= Date: Mon, 3 Apr 2023 08:14:32 +0200 Subject: [PATCH 3/5] chore: Corrected package version. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e7e983b..ab898db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tv2media/logger", - "version": "1.2.4", + "version": "2.0.0", "license": "MIT", "main": "dist/cjs/index.js", "types": "dist/cjs/index.d.ts", From 56bf4507a405d60f29f1207ccd01c26b0e222c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Frederik=20J=C3=B8rgensen?= Date: Mon, 3 Apr 2023 08:16:15 +0200 Subject: [PATCH 4/5] chore: Updated deprecacted GitHub Actions syntax and package versions. --- .github/actions/branch-exists/action.yml | 6 ++-- .github/actions/cache/action.yml | 4 +-- .github/actions/check-secret/action.yml | 6 ++-- .github/workflows/node-ci.dev.yml | 20 ++++++------ .github/workflows/node-ci.prod.yml | 40 ++++++++++++------------ 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/.github/actions/branch-exists/action.yml b/.github/actions/branch-exists/action.yml index 96d8766..c5e3c99 100644 --- a/.github/actions/branch-exists/action.yml +++ b/.github/actions/branch-exists/action.yml @@ -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: @@ -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 diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml index 55e7abd..5dc3fd8 100644 --- a/.github/actions/cache/action.yml +++ b/.github/actions/cache/action.yml @@ -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 }} \ No newline at end of file + cache: ${{ env.node-package-manager }} diff --git a/.github/actions/check-secret/action.yml b/.github/actions/check-secret/action.yml index 11883a6..4d62a97 100644 --- a/.github/actions/check-secret/action.yml +++ b/.github/actions/check-secret/action.yml @@ -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: @@ -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 diff --git a/.github/workflows/node-ci.dev.yml b/.github/workflows/node-ci.dev.yml index 565b97f..af332d7 100644 --- a/.github/workflows/node-ci.dev.yml +++ b/.github/workflows/node-ci.dev.yml @@ -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 @@ -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: @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/node-ci.prod.yml b/.github/workflows/node-ci.prod.yml index 5146561..f798bf8 100644 --- a/.github/workflows/node-ci.prod.yml +++ b/.github/workflows/node-ci.prod.yml @@ -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. # ####################################################################################################################### @@ -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 @@ -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 @@ -56,7 +56,7 @@ jobs: needs: cache-dependencies steps: - name: Access repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - uses: ./.github/actions/test @@ -64,7 +64,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Access repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - uses: ./.github/actions/validate-dependencies bump-version: @@ -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 }}" @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -228,17 +228,17 @@ 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" @@ -246,7 +246,7 @@ jobs: run: yarn install shell: bash - 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 --new-version "${{ needs.bump-version.outputs.version }}" env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -257,7 +257,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 @@ -277,9 +277,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 From a52dd8638910bf732660a26cb66f68e62192f807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Frederik=20J=C3=B8rgensen?= Date: Mon, 3 Apr 2023 08:35:35 +0200 Subject: [PATCH 5/5] chore: Ensure new package.json version for npm publish workflow. --- .github/workflows/node-ci.prod.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node-ci.prod.yml b/.github/workflows/node-ci.prod.yml index f798bf8..90c5827 100644 --- a/.github/workflows/node-ci.prod.yml +++ b/.github/workflows/node-ci.prod.yml @@ -245,8 +245,10 @@ jobs: - 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 npm 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 }}