From a4c0ef542f6a4ee9abf066a69c17ba68ec2c2a82 Mon Sep 17 00:00:00 2001 From: Brett <27568879+BrettCleary@users.noreply.github.com> Date: Thu, 25 Apr 2024 14:25:26 -0700 Subject: [PATCH] fix lint, update gha's to use shared workflows --- .github/workflows/lint.yml | 34 +++++------ .github/workflows/publish-next-auth-steam.yml | 61 +++---------------- package-lock.json | 4 +- 3 files changed, 26 insertions(+), 73 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 616a3b9..9e00fd2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,23 +6,17 @@ on: workflow_dispatch: jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '16' - cache: 'yarn' - - name: Reconfigure git to use HTTP authentication - run: > - git config --global url."https://github.com/".insteadOf - ssh://git@github.com/ - - name: Authenticate with private NPM package - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc - - name: Install modules. - run: yarn install --frozen-lockfile --immutable - - name: Lint code. - run: yarn lint - - name: Prettier code. - run: yarn prettier + test: + uses: HyperPlay-Gaming/workflows/.github/workflows/nodejs_commands.yml@main + with: + node_version: '18' + pkg_manager: 'npm' + install: 'npm install' + name: 'test' + command_one: 'npm run lint' + command_one_name: 'Lint' + command_two: 'npm run prettier' + command_two_name: 'Prettier code.' + checkout_recursive: false + secrets: + NPM_TOKEN: '${{ secrets.NPM_TOKEN }}' diff --git a/.github/workflows/publish-next-auth-steam.yml b/.github/workflows/publish-next-auth-steam.yml index 04e2011..94b9be1 100644 --- a/.github/workflows/publish-next-auth-steam.yml +++ b/.github/workflows/publish-next-auth-steam.yml @@ -9,54 +9,13 @@ on: jobs: release: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '16' - cache: 'npm' - registry-url: 'https://registry.npmjs.org' - - - name: Install dependencies - run: | - echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ./.npmrc - npm ci - - - name: Get previous version - id: get_previous_version - run: | - echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ./.npmrc - npm view @hyperplay/next-auth-steam version --verbose - echo ::set-output name=previous_version::$(npm view @hyperplay/next-auth-steam version | tr -d '[:space:]') - - - name: Set current version - id: set_current_version - run: echo ::set-output name=current_version::$(node -p "require('./package.json').version") - - - name: Compare versions - id: compare_versions - env: - PREVIOUS_VERSION: ${{ steps.get_previous_version.outputs.previous_version }} - CURRENT_VERSION: ${{ steps.set_current_version.outputs.current_version }} - run: echo ::set-output name=do_release::$(node -p "Number(process.env.INPUT_FORCE_RELEASE) || require('semver/functions/gt')(process.env.CURRENT_VERSION, process.env.PREVIOUS_VERSION)") - - - name: Build @hyperplay/next-auth-steam - if: steps.compare_versions.outputs.do_release == 'true' - run: | - npm run build - - - name: Release to npm - if: steps.compare_versions.outputs.do_release == 'true' - run: | - echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ./.npmrc - if [[ ${{ steps.set_current_version.outputs.current_version }} == *"-alpha"* ]]; then - npm publish --tag alpha - elif [[ ${{ steps.set_current_version.outputs.current_version }} == *"-beta"* ]]; then - npm publish --tag beta - else - npm publish - fi; + uses: HyperPlay-Gaming/workflows/.github/workflows/npm_publish.yml@main + with: + node_version: '18' + pkg_manager: 'npm' + install: 'npm install' + build: 'npm run build' + publish: 'npm publish' + pkg_manager_add_dev_dep: 'npm install --save-dev' + secrets: + NPM_TOKEN: '${{ secrets.NPM_TOKEN }}' diff --git a/package-lock.json b/package-lock.json index 6382f6c..908e622 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@hyperplay/next-auth-steam", - "version": "0.2.4", + "version": "0.2.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@hyperplay/next-auth-steam", - "version": "0.2.4", + "version": "0.2.5", "license": "MIT", "dependencies": { "@types/uuid": "^9.0.7",