Skip to content

Commit

Permalink
fix lint, update gha's to use shared workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettCleary committed Apr 25, 2024
1 parent 6dc3163 commit a4c0ef5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 73 deletions.
34 changes: 14 additions & 20 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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://[email protected]/
- 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 }}'
61 changes: 10 additions & 51 deletions .github/workflows/publish-next-auth-steam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a4c0ef5

Please sign in to comment.