Skip to content

Commit

Permalink
[chore] Fit Github Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
amivanoff committed Jul 31, 2024
1 parent 7eb9864 commit 37e5cda
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,29 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['22.x']
os: [ubuntu-latest, windows-latest]
node: ['22.0']
os: [ubuntu-latest]

steps:
- name: Config Git (Mainly for Windows)
run: git config --global core.autocrlf false

- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install Node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- uses: pnpm/action-setup@v4
name: Install pnpm
cache: 'pnpm'

- name: Install deps and build (with cache)
run: pnpm install

- name: Lint
- name: Lint code
run: pnpm lint
# Did not work without local files with test data
# - name: Test
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,29 @@ name: Publish to NPM
on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install pnpm
uses: pnpm/action-setup@v4

# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
- name: Install Node 22.0
uses: actions/setup-node@v4
with:
node-version: '22.x'
node-version: '22.0'
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- uses: pnpm/action-setup@v4

- run: pnpm install
- name: Install deps and build (with cache)
run: pnpm install

- run: pnpm publish
- name: Publish build
run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"eslint"
]
},
"packageManager": "^[email protected]",
"packageManager": "[email protected]",
"browser": {
"_process": false,
"fs": false,
Expand Down

0 comments on commit 37e5cda

Please sign in to comment.