Skip to content

Commit

Permalink
chore: soft fork changes
Browse files Browse the repository at this point in the history
This commit contains changes that should be rebased on top of upstream.
  • Loading branch information
johnwchadwick committed Oct 19, 2021
1 parent 1ab4bc8 commit bfe0b44
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 115 deletions.
199 changes: 91 additions & 108 deletions .github/workflows/build-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
- develop

env:
NODE_LIBCURL_GITHUB_TOKEN: ${{ secrets.NODE_LIBCURL_GITHUB_TOKEN }}
NODE_LIBCURL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# all jobs here must have a matrix identical to the ones inside build-lint-test.yaml

Expand All @@ -26,23 +26,11 @@ jobs:
matrix:
os:
- macos-11
- ubuntu-16.04 # TODO(jonathan): bump this to a more recent version when we do a major version bump
- ubuntu-18.04
libcurl-release:
- 7.73.0
node:
- 10
- 12
- 14
- 16
include:
- os: macos-11
libcurl-release: 7.73.0
node: 16
node-libcurl-cpp-std: c++17
- os: ubuntu-16.04
libcurl-release: 7.73.0
node: 16
node-libcurl-cpp-std: c++17
env:
LIBCURL_RELEASE: ${{ matrix.libcurl-release }}
LATEST_LIBCURL_RELEASE: ${{ matrix.libcurl-release }}
Expand All @@ -54,8 +42,6 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: echo "NODE_LIBCURL_CPP_STD=${{ matrix.node-libcurl-cpp-std }}" >> $GITHUB_ENV
if: matrix.node-libcurl-cpp-std
- if: runner.os == 'macOS'
name: Install Needed packages on macOS
run: brew install coreutils wget automake libtool cmake gnu-sed m4
Expand Down Expand Up @@ -93,9 +79,9 @@ jobs:
path: |
~/.node-gyp
~/deps
key: v4-${{ runner.os }}-libcurl-deps-cache-node-${{ matrix.node }}
key: v4-${{ runner.os }}-libcurl-deps-cache-node-${{ matrix.node }}-fork
restore-keys: |
v4-${{ runner.os }}-libcurl-deps-cache-node-${{ matrix.node }}
v4-${{ runner.os }}-libcurl-deps-cache-node-${{ matrix.node }}-fork
- name: 'Set GIT_TAG'
if: startsWith(github.ref, 'refs/tags')
run: echo "GIT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
Expand All @@ -111,47 +97,38 @@ jobs:
retention-days: 5

build-and-release-electron:
runs-on: macos-11
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-11
- ubuntu-18.04
libcurl-release:
- 7.73.0
node:
- 16
- 12
electron-version:
- 12.0.0
- 11.2.3
- 10.1.0
- 9.3.3
- 8.5.3
include:
- libcurl-release: 7.73.0
node: 16
electron-version: 12.0.0
node-libcurl-cpp-std: c++17
- libcurl-release: 7.73.0
node: 16
electron-version: 11.2.3
node-libcurl-cpp-std: c++17
- 11.5.0
env:
LIBCURL_RELEASE: ${{ matrix.libcurl-release }}
LATEST_LIBCURL_RELEASE: ${{ matrix.libcurl-release }}
ELECTRON_VERSION: ${{ matrix.electron-version }}
NODE_LIBCURL_CPP_STD: c++11
NODE_LIBCURL_CPP_STD: c++17
steps:
- run: echo "NODE_LIBCURL_CPP_STD=${{ matrix.node-libcurl-cpp-std }}" >> $GITHUB_ENV
if: matrix.node-libcurl-cpp-std
- name: Checkout
uses: actions/checkout@main
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install Needed packages
- if: runner.os == 'macOS'
name: Install Needed packages
run: brew install coreutils wget automake libtool cmake gnu-sed m4
# not using brew for that one as we need 2.69
- name: Install autoconf
- if: runner.os == 'macOS'
name: Install autoconf
run: |
curl -O -L http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz
tar -xzf autoconf-2.69.tar.gz
Expand All @@ -161,6 +138,9 @@ jobs:
make install
autoconf --version
ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize
- if: runner.os == 'Linux'
name: Install Needed packages on Linux
run: sudo apt-get install -y cmake
- name: Output yarn cache dir
id: yarn-cache-dir
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down Expand Up @@ -188,9 +168,9 @@ jobs:
path: |
~/.node-gyp
~/deps
key: v4-${{ runner.os }}-libcurl-deps-cache-electron-${{ matrix.electron-version }}
key: v4-${{ runner.os }}-libcurl-deps-cache-electron-${{ matrix.electron-version }}-fork
restore-keys: |
v4-${{ runner.os }}-libcurl-deps-cache-electron-${{ matrix.electron-version }}
v4-${{ runner.os }}-libcurl-deps-cache-electron-${{ matrix.electron-version }}-fork
- name: 'Set GIT_TAG'
if: startsWith(github.ref, 'refs/tags')
run: echo "GIT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
Expand All @@ -205,87 +185,90 @@ jobs:
path: ./logs/
retention-days: 5

build-and-release-nwjs:
runs-on: macos-11
build-and-release-nodejs-windows:
runs-on: windows-2016
strategy:
fail-fast: false
matrix:
libcurl-release:
- 7.73.0
node:
- 16
nwjs-version:
- 0.52.0
- 0.51.2
- 0.49.2
include:
- libcurl-release: 7.73.0
node: 16
nwjs-version: 0.52.0
node-libcurl-cpp-std: c++17
- libcurl-release: 7.73.0
node: 16
nwjs-version: 0.51.2
node-libcurl-cpp-std: c++17
- 12
env:
LIBCURL_RELEASE: ${{ matrix.libcurl-release }}
LATEST_LIBCURL_RELEASE: ${{ matrix.libcurl-release }}
NWJS_VERSION: ${{ matrix.nwjs-version }}
NODE_LIBCURL_CPP_STD: c++11
npm_config_msvs_version: 2017
npm_config_build_from_source: true
steps:
- run: echo "NODE_LIBCURL_CPP_STD=${{ matrix.node-libcurl-cpp-std }}" >> $GITHUB_ENV
if: matrix.node-libcurl-cpp-std
- name: Checkout
uses: actions/checkout@main
with:
submodules: recursive
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install Needed packages
run: brew install coreutils wget automake libtool cmake gnu-sed m4
# not using brew for that one as we need 2.69
- name: Install autoconf
- name: Install dependencies
run: |
curl -O -L http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz
tar -xzf autoconf-2.69.tar.gz
cd autoconf-*
./configure
make
make install
autoconf --version
ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize
- name: Output yarn cache dir
id: yarn-cache-dir
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore Yarn Cache
uses: actions/cache@v2
id: yarn-cache
cinst nasm -y
python deps\curl-for-windows\configure.py
- name: Build
run: |
$env:PATH=$env:PROGRAMFILES + "\NASM;" + $env:Path
yarn install --frozen-lockfile
- name: Test
run: |
yarn ts-node -e "console.log(require('./lib').Curl.getVersionInfoString())"
yarn test
if ($LASTEXITCODE -eq 0) {
$host.SetShouldExit(0)
}
- name: Publish binary
if: startsWith(github.ref, 'refs/tags/')
run: |
yarn node-pre-gyp package testpackage --verbose
node scripts\module-packaging.js --publish $(yarn -s node-pre-gyp reveal staged_tarball --silent)
build-and-release-electron-windows:
runs-on: windows-2016
strategy:
fail-fast: false
matrix:
node:
- 12
electron-version:
- 11.2.3
env:
ELECTRON_VERSION: ${{ matrix.electron-version }}
npm_config_msvs_version: 2017
npm_config_build_from_source: true
npm_config_runtime: "electron"
npm_config_dist_url: "https://atom.io/download/electron"
npm_config_target: ${{ matrix.electron-version }}
steps:
- name: Checkout
uses: actions/checkout@main
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: v1-${{ runner.os }}-yarn-cache-${{ github.ref }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
v1-${{ runner.os }}-yarn-cache-${{ github.ref }}-
v1-${{ runner.os }}-yarn-cache-
- name: Restore libcurl deps cache
uses: actions/cache@v2
id: libcurl-deps-cache
submodules: recursive
- name: Setup Node.js
uses: actions/setup-node@v1
with:
path: |
~/.node-gyp
~/deps
key: v4-${{ runner.os }}-libcurl-deps-cache-nwjs-${{ matrix.nwjs-version }}
restore-keys: |
v4-${{ runner.os }}-libcurl-deps-cache-nwjs-${{ matrix.nwjs-version }}
- name: 'Set GIT_TAG'
if: startsWith(github.ref, 'refs/tags')
run: echo "GIT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: 'Publish Binary'
node-version: ${{ matrix.node }}
- name: Install dependencies
run: |
GIT_COMMIT=${{ github.sha }} GIT_TAG=$GIT_TAG ./scripts/ci/build.sh
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v2
with:
name: build-logs
path: ./logs/
retention-days: 5
cinst nasm -y
python deps\curl-for-windows\configure.py
yarn global add electron@${env:ELECTRON_VERSION}
- name: Build
run: |
$env:PATH=$env:PROGRAMFILES + "\NASM;" + $env:Path
yarn install --frozen-lockfile
- name: Test
run: |
yarn test:electron
if ($LASTEXITCODE -eq 0) {
$host.SetShouldExit(0)
}
- name: Publish binary
if: startsWith(github.ref, 'refs/tags/')
run: |
yarn node-pre-gyp package testpackage --verbose
node scripts\module-packaging.js --publish $(yarn -s node-pre-gyp reveal staged_tarball --silent)
34 changes: 34 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: publish

on:
push:
tags:
- '*'

jobs:
publish:
runs-on: ubuntu-18.04
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
node:
- 12
steps:
- name: Checkout
uses: actions/checkout@main
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
registry-url: 'https://registry.npmjs.org'
- name: Install
run: yarn install --ignore-scripts
- name: Build
run: yarn build:dist
- name: Publish Package
run: yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-libcurl",
"version": "2.3.3",
"name": "@getinsomnia/node-libcurl",
"version": "v2.3.4-alpha.0",
"description": "The fastest http(s) client (and much more) for Node.js - Node.js bindings for libcurl",
"keywords": [
"node-curl",
Expand All @@ -10,13 +10,13 @@
"axios",
"request"
],
"homepage": "https://github.com/JCMais/node-libcurl",
"homepage": "https://github.com/Kong/node-libcurl",
"bugs": {
"url": "https://github.com/JCMais/node-libcurl/issues"
"url": "https://github.com/Kong/node-libcurl/issues"
},
"repository": {
"type": "git",
"url": "git://github.com/JCMais/node-libcurl.git"
"url": "git://github.com/Kong/node-libcurl.git"
},
"license": "MIT",
"author": "Jonathan Cardoso <me@jonathancardoso.com>",
Expand All @@ -27,7 +27,7 @@
"module_path": "./lib/binding/",
"remote_path": "./v{version}/",
"package_name": "{module_name}-v{version}-{node_abi}-{platform}-{arch}-{libc}.tar.gz",
"host": "https://github.com/JCMais/node-libcurl/releases/download"
"host": "https://github.com/Kong/node-libcurl/releases/download"
},
"scripts": {
"ae": "api-extractor run --local --verbose",
Expand Down
2 changes: 1 addition & 1 deletion scripts/module-packaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (args[0] !== validArgs[0] && args[0] !== validArgs[1]) {
}

const octo = octonode.client(process.env['NODE_LIBCURL_GITHUB_TOKEN'])
const repo = octo.repo('JCMais/node-libcurl')
const repo = octo.repo('Kong/node-libcurl')
const commands = {
publish: publish,
unpublish: unpublish,
Expand Down

0 comments on commit bfe0b44

Please sign in to comment.