Skip to content

Commit

Permalink
Revert to yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
ranisalt committed Dec 9, 2023
1 parent 434e208 commit 1f7d7d3
Show file tree
Hide file tree
Showing 6 changed files with 1,346 additions and 2,153 deletions.
54 changes: 33 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,66 @@ name: CI
on: [push, pull_request]

env:
YARN_GPG: no
npm_config_debug: yes
npm_config_build_from_source: true

jobs:
test:
name: Test for node-${{ matrix.node-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [18, 20]
os: [ubuntu-20.04, macos-11, macos-m1, windows-2019]

name: Test for node-${{ matrix.node-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- uses: actions/setup-node@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
cache: yarn
node-version: ${{ matrix.node-version }}

- run: corepack enable
- run: pnpm install --frozen-lockfile
- run: pnpm test
- name: Install dependencies
run: yarn install

- name: Run tests
run: yarn test

test-alpine:
name: Test for node-${{ matrix.node-version }} on Alpine Linux
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]

name: Test for node-${{ matrix.node-version }} on Alpine Linux
runs-on: ubuntu-latest

container:
image: node:${{ matrix.node-version }}-alpine

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- uses: actions/setup-node@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
cache: yarn
node-version: ${{ matrix.node-version }}

- run: corepack enable
- run: apk add make g++ python3 git
- run: pnpm install --frozen-lockfile
- run: pnpm test
- name: Install dependencies
run: yarn install

- name: Run tests
run: yarn test

test-freebsd:
strategy:
Expand All @@ -61,17 +73,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- uses: vmactions/freebsd-vm@v1
with:
envs: 'npm_config_debug npm_config_build_from_source'
envs: 'YARN_GPG npm_config_debug npm_config_build_from_source'
prepare: |
pkg install -y gmake python3 node${{ matrix.node-version }}
corepack enable
pkg install -y gmake python3 yarn-node${{ matrix.node-version }}
run: |
pnpm install --frozen-lockfile
pnpm test
yarn install
yarn test
sync: sshfs
89 changes: 53 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,45 +13,54 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- uses: actions/setup-node@v4
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
cache: yarn
node-version: 18

- run: corepack enable
- run: pnpm install --frozen-lockfile
- name: Install dependencies
run: yarn install

- run: pnpm publish
- name: Publish to NPM
run: yarn publish
if: ${{ !env.ACT }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-11, macos-m1, windows-2019]

name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- uses: actions/setup-node@v4
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
cache: yarn
node-version: 18

- run: corepack enable
- run: pnpm install --frozen-lockfile
- name: Install dependencies
run: yarn install

- name: Package artifacts
run: pnpm node-pre-gyp package
run: yarn node-pre-gyp package

- uses: csexton/release-asset-action@v2
- name: Upload to Release
uses: csexton/release-asset-action@v2
if: ${{ !env.ACT }}
with:
pattern: build/stage/**/argon2*.tar.gz
Expand All @@ -65,31 +74,34 @@ jobs:
image: node:18-alpine

steps:
- uses: actions/checkout@v4
- name: Install build deps
run: apk add make g++ python3 git

- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

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

- run: corepack enable
- run: apk add make g++ python3 git
- run: pnpm install --frozen-lockfile
- name: Install dependencies
run: yarn install

- name: Package artifacts
run: pnpm node-pre-gyp package
run: yarn node-pre-gyp package

- uses: csexton/release-asset-action@v2
- name: Upload to Release
uses: csexton/release-asset-action@v2
if: ${{ !env.ACT }}
with:
pattern: build/stage/**/argon2*.tar.gz
github-token: ${{ secrets.GITHUB_TOKEN }}
release-url: ${{ github.event.release.upload_url }}

build-arm:
name: Build on arm64
runs-on: ubuntu-latest
strategy:
matrix:
include:
Expand All @@ -98,13 +110,17 @@ jobs:
- arch: aarch64
distro: alpine_latest

name: Build on arm64
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- uses: uraimo/run-on-arch-action@v2
name: Package artifacts
- name: Package artifacts
uses: uraimo/run-on-arch-action@v2
id: build
with:
arch: ${{ matrix.arch }}
Expand All @@ -121,17 +137,18 @@ jobs:
;;
alpine*)
apk add --update make g++ python3
apk add --repository https://dl-cdn.alpinelinux.org/alpine/v3.17/main/ nodejs~=18 npm
apk add --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/v3.17/main/ nodejs~=18 npm
;;
esac
corepack enable
run: |
cd /repo
pnpm install --frozen-lockfile
pnpm node-pre-gyp package
yarn install --frozen-lockfile
yarn node-pre-gyp package
- uses: csexton/release-asset-action@v2
- name: Upload to Release
uses: csexton/release-asset-action@v2
if: ${{ !env.ACT }}
with:
pattern: build/stage/**/argon2*.tar.gz
Expand All @@ -147,19 +164,19 @@ jobs:
with:
submodules: true

- uses: vmactions/freebsd-vm@v1
name: Package artifacts
- name: Package artifacts
uses: vmactions/freebsd-vm@v1
with:
envs: 'npm_config_build_from_source'
prepare: |
pkg install -y gmake python3 node18
corepack enable && corepack prepare pnpm@latest --activate
pkg install -y gmake python3 yarn-node18
run: |
pnpm install --frozen-lockfile
pnpm node-pre-gyp package
yarn install --frozen-lockfile
yarn node-pre-gyp package
sync: sshfs

- uses: csexton/release-asset-action@v2
- name: Upload to Release
uses: csexton/release-asset-action@v2
if: ${{ !env.ACT }}
with:
pattern: build/stage/**/argon2*.tar.gz
Expand Down
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"prettier": "^3.0.3",
"typescript": "^5.2.2"
},
"packageManager": "[email protected].2+sha256.487609e857f1c11780cc98dd0bfe4c8a8b11c7f23bc3a4493ac7d263d6fb6c8c",
"packageManager": "[email protected].2+sha256.825003a0f561ad09a3b1ac4a3b3ea6207af2796d54f62a9420520915721f5186",
"engines": {
"node": ">=18.13.0"
},
Expand Down
Loading

0 comments on commit 1f7d7d3

Please sign in to comment.