Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node release workflow #378

Merged
merged 129 commits into from
Sep 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
ab01fc8
Update package.json
acalcutt Apr 25, 2022
af985ce
try to get publish working
acalcutt Apr 25, 2022
3bc4391
Update node-ci.yml
acalcutt Apr 25, 2022
103921e
Update node-ci.yml
acalcutt Apr 25, 2022
753eedf
Update package.json
acalcutt Apr 25, 2022
bd2bf52
Update package.json
acalcutt Apr 25, 2022
e8d6ac7
Update package.json
acalcutt Apr 25, 2022
e4b3374
Try github publish
acalcutt Apr 26, 2022
a416a0d
fix missing comma
acalcutt Apr 26, 2022
187217b
Update package-lock.json
acalcutt Apr 26, 2022
47e250f
change publish order
acalcutt Apr 26, 2022
fe87e4a
remove old node-pre-gyp
acalcutt Apr 26, 2022
577144b
Revert "remove old node-pre-gyp"
acalcutt Apr 26, 2022
50efb32
change to NODE_PRE_GYP_GITHUB_TOKEN
acalcutt Apr 26, 2022
93be6a9
change url format to try and fix error
acalcutt Apr 26, 2022
f30e932
Revert "change to NODE_PRE_GYP_GITHUB_TOKEN"
acalcutt Apr 26, 2022
1135485
put back NODE_PRE_GYP_GITHUB_TOKEN
acalcutt Apr 26, 2022
5f111f5
remove other builds for now, remove matrix.os
acalcutt Apr 26, 2022
62f5b55
fix user?
acalcutt Apr 26, 2022
c09aa6b
change remote_path
acalcutt Apr 26, 2022
f0874ab
Update package.json
acalcutt Apr 26, 2022
69a64fa
use node-pre-gyp-github that uses main instead of master
acalcutt Apr 26, 2022
2915d1c
update version
acalcutt Apr 26, 2022
ed7a06d
fix "remate_path", which gets used as "tag_name"
acalcutt Apr 26, 2022
2740339
try updating links
acalcutt Apr 26, 2022
1995cc5
put back macos-11.0
acalcutt Apr 26, 2022
22da555
Update version to test new release
acalcutt Apr 26, 2022
4219597
set to false to see if this works
acalcutt Apr 26, 2022
49f867d
put back host url
acalcutt Apr 26, 2022
1ce1d17
try to make npm only publish once
acalcutt Apr 26, 2022
322d97f
Put back allow fallback to build
acalcutt Apr 27, 2022
b28091c
Merge branch 'main' of https://github.com/maplibre/maplibre-gl-native…
acalcutt Apr 27, 2022
f01e1f9
publish merge
acalcutt Apr 27, 2022
6802c62
see if reverting this will shield text alignment
acalcutt Apr 28, 2022
122d33a
Update package.json
acalcutt Apr 28, 2022
c9b7c51
Revert "see if reverting this will shield text alignment"
acalcutt Apr 28, 2022
c171735
Update package.json
acalcutt Apr 28, 2022
b106aca
try to add other node versions
acalcutt Apr 28, 2022
c1de1d7
only publish to npm once
acalcutt Apr 28, 2022
d3e811d
add more node versions
acalcutt Apr 28, 2022
8958d3b
Revert "[msvc] Fix warnings, mainly casting to smaller types (#270)"
acalcutt May 16, 2022
56b456f
Update package.json
acalcutt May 16, 2022
5dbe43b
Revert "Revert "[msvc] Fix warnings, mainly casting to smaller types …
acalcutt May 17, 2022
ee068f8
try fix from @rmyhal in https://github.com/maplibre/maplibre-gl-nativ…
acalcutt May 17, 2022
0adf3cc
5.0.16 bump
acalcutt May 17, 2022
cea8967
add continue one error, change npm publish node version
acalcutt May 17, 2022
37291b9
Update macos-ci.yml
acalcutt May 17, 2022
eb3f23d
Update package.json
acalcutt May 17, 2022
923a789
remove publish steps from ci
acalcutt May 22, 2022
93324e2
add publish on node tag
acalcutt May 22, 2022
4cf154b
on manual release
acalcutt May 22, 2022
607cd31
use lower os versions
acalcutt May 22, 2022
18dda90
Merge remote-tracking branch 'upstream/main' into main
acalcutt May 28, 2022
51a7342
put linux os back to ubuntu-20.04
acalcutt May 28, 2022
f9f0573
increase version
acalcutt May 28, 2022
193221c
put linux os back to ubuntu-20.04
acalcutt May 28, 2022
1e08a01
increase version
acalcutt May 28, 2022
c69a54f
fix npm publish version
acalcutt May 29, 2022
7fccbb2
increase version
acalcutt May 29, 2022
14cf9a7
Merge remote-tracking branch 'upstream/main' into main
acalcutt Jul 5, 2022
7809345
increase version
acalcutt Jul 5, 2022
9d887c9
Update package-lock.json
acalcutt Jul 5, 2022
fe01bc0
Merge remote-tracking branch 'acalcutt/main' into node-release
acalcutt Jul 30, 2022
3501b70
put back maplibre git urls, cut down number of node releases
acalcutt Jul 30, 2022
5701f21
fix package-lock
acalcutt Jul 30, 2022
f7152a2
update package-lock
acalcutt Jul 30, 2022
adb02b2
add "node" to release name with change to @acalcutt/node-pre-gyp-github
acalcutt Jul 30, 2022
0ac3846
fix package-lock
acalcutt Jul 30, 2022
8d112ee
Update @acalcutt/node-pre-gyp-github so that the github release start…
acalcutt Jul 30, 2022
7ae1a9b
removed some node versions
acalcutt Jul 30, 2022
c6b7e96
Change tag sep from _ to - to match other release tags
acalcutt Jul 30, 2022
1e184f5
Change tag sep from _ to - to match other release tags
acalcutt Jul 30, 2022
cd692e9
Changed environment secrets
acalcutt Aug 11, 2022
8c0389c
Merge remote-tracking branch 'upstream/main'
acalcutt Aug 19, 2022
70e7605
only use one osx release
acalcutt Aug 19, 2022
4146266
increase version
acalcutt Aug 19, 2022
b3c25ab
update package-lock.json
acalcutt Aug 19, 2022
dfe9dcd
Adding a small development setup for Visual Studio Code
thehoneymad Aug 24, 2022
bfb0489
Merge remote-tracking branch 'upstream/main'
acalcutt Aug 27, 2022
12202b5
Merge remote-tracking branch 'thehoneymad/thehoneymad/main'
acalcutt Aug 27, 2022
8f78baa
map map mode user variable?
acalcutt Aug 27, 2022
0c8447c
with map mode 2
acalcutt Aug 27, 2022
b16e1bc
Update to macos-12
acalcutt Sep 8, 2022
71c318c
try to add version bump
acalcutt Sep 8, 2022
5b9002b
try to move versioning to its own job due to matrix
acalcutt Sep 8, 2022
22edcba
Update version (patch)
invalid-email-address Sep 8, 2022
dde3e17
try to add git pull so version updates in build job
acalcutt Sep 8, 2022
6300d2e
Merge branch 'main' of https://github.com/acalcutt/maplibre-gl-native
acalcutt Sep 8, 2022
a3cd592
Add git pull to get latest version
acalcutt Sep 8, 2022
6616541
fix job name
acalcutt Sep 8, 2022
e97b13d
Update version (patch)
invalid-email-address Sep 8, 2022
6e0a4a5
try to simplify
acalcutt Sep 8, 2022
8e188f0
Merge branch 'main' of https://github.com/acalcutt/maplibre-gl-native
acalcutt Sep 8, 2022
3383440
Try to add pre-release
acalcutt Sep 8, 2022
479ae57
Update node version to (prerelease)
invalid-email-address Sep 8, 2022
d3916e5
workflow order change
acalcutt Sep 8, 2022
a0c868a
Merge branch 'main' of https://github.com/acalcutt/maplibre-gl-native
acalcutt Sep 8, 2022
7c503d5
Update node version to (prerelease)
invalid-email-address Sep 8, 2022
9a5777b
Update node version to (patch)
invalid-email-address Sep 8, 2022
3c7cecb
workflow changes
acalcutt Sep 8, 2022
bc71c6d
Update node version to (prerelease)
invalid-email-address Sep 8, 2022
aed4005
Update node version to (patch)
invalid-email-address Sep 8, 2022
59c2b43
Update node version to (prerelease)
invalid-email-address Sep 8, 2022
33aa6d4
Update node version to (patch)
invalid-email-address Sep 8, 2022
36c5961
workflow
acalcutt Sep 8, 2022
fb75f0c
Update node version to (prerelease)
invalid-email-address Sep 8, 2022
501baed
Update node version to (patch)
invalid-email-address Sep 8, 2022
084d212
Update node version to (patch)
invalid-email-address Sep 8, 2022
b1adb2a
remove prelease to see if it fixes release issues
acalcutt Sep 8, 2022
0c0186e
Update node version to (prerelease)
invalid-email-address Sep 8, 2022
3fc0bf5
Update node version to (minor)
invalid-email-address Sep 8, 2022
dd224b4
Merge remote-tracking branch 'upstream/main' into node-release
acalcutt Sep 9, 2022
e8d8297
Merge remote-tracking branch 'acalcutt/main' into node-release
acalcutt Sep 9, 2022
7d54fcf
Revert "Merge remote-tracking branch 'thehoneymad/thehoneymad/main'"
acalcutt Sep 9, 2022
e5eb1ec
Update package-lock.json
acalcutt Sep 9, 2022
0423976
allow for pre-release with versions that include "pre"
acalcutt Sep 9, 2022
31bc9a5
npm publish pre-release has next tag
acalcutt Sep 9, 2022
9e2d194
change npm release version
acalcutt Sep 9, 2022
fe71073
make requested changes
acalcutt Sep 9, 2022
52ef7f8
Merge remote-tracking branch 'upstream/main' into node-release
acalcutt Sep 9, 2022
c0daffd
Update package-lock.json
acalcutt Sep 9, 2022
ce85037
change node version to the latest
acalcutt Sep 9, 2022
62a794b
put back node 10 for mabox comparison purposes
acalcutt Sep 9, 2022
6c11231
put back macos-12 since ARM64 won't work
acalcutt Sep 10, 2022
1b5a088
Merge remote-tracking branch 'upstream/main' into node-release
acalcutt Sep 10, 2022
5679105
Update package-lock.json
acalcutt Sep 10, 2022
6305fbc
change job name
acalcutt Sep 11, 2022
dd21007
change matrix
acalcutt Sep 11, 2022
81a1179
Revert "change matrix"
acalcutt Sep 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,16 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
build:
test:
strategy:
matrix:
os:
- [self-hosted, macOS, ARM64]
birkskyum marked this conversation as resolved.
Show resolved Hide resolved
- macos-12
- ubuntu-20.04
node: [ 10, 14, 16, 18 ]
birkskyum marked this conversation as resolved.
Show resolved Hide resolved
name: OS ${{ matrix.os }} Node ${{ matrix.node }}
runs-on: ${{ matrix.os }}
continue-on-error: true
env:
BUILDTYPE: ${{github.ref == 'refs/heads/main' && 'Release' || 'Debug'}}

Expand Down Expand Up @@ -123,6 +126,11 @@ jobs:
libc++-9-dev \
libc++abi-9-dev
/usr/sbin/update-ccache-symlinks

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: npm ci
run: npm ci --ignore-scripts
Expand Down Expand Up @@ -186,10 +194,3 @@ jobs:
if: github.ref != 'refs/heads/main'
run: |
npm pack --dry-run

# Uncomment to start publishing the package
# @TODO: Figure out the binary distribution method.
# - name: Publish package
# if: github.ref == 'refs/heads/main'
# run: |
# npm publish
185 changes: 185 additions & 0 deletions .github/workflows/node-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
name: node-release

on:
workflow_dispatch:
inputs:
version:
description: Choose a release type
required: true
type: choice
options:
- prerelease
- patch
- minor
- major

jobs:
bump_version:
runs-on: ubuntu-20.04

defaults:
run:
working-directory: ./
shell: bash

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Bump Version
run: |
git config user.name github-actions
git config user.email github-actions@github.com
npm version ${{ github.event.inputs.version }} --preid pre -m "Update node version to (${{ github.event.inputs.version }})"
git push

build:
strategy:
matrix:
os:
- macos-12
birkskyum marked this conversation as resolved.
Show resolved Hide resolved
- ubuntu-20.04
node: [ 10, 14, 16, 18 ]
birkskyum marked this conversation as resolved.
Show resolved Hide resolved
name: OS ${{ matrix.os }} Node ${{ matrix.node }}
runs-on: ${{ matrix.os }}
needs: bump_version
continue-on-error: true
env:
BUILDTYPE: ${{github.ref == 'refs/heads/main' && 'Release' || 'Debug'}}

defaults:
run:
working-directory: ./
shell: bash

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: Get Latest Version
run: git pull

- name: Install dependencies
if: runner.os == 'macOS'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: |
brew list cmake || brew install cmake
brew list ccache || brew install ccache
brew list ninja || brew install ninja
brew list pkg-config || brew install pkg-config
brew list glfw3 || brew install glfw3
brew list libuv || brew install libuv

- name: Install dependencies
if: runner.os == 'Linux'
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
sudo apt-get install -y \
ccache \
cmake \
ninja-build \
pkg-config \
xvfb \
libcurl4-openssl-dev \
libglfw3-dev \
libuv1-dev \
g++-10 \
libc++-9-dev \
libc++abi-9-dev
/usr/sbin/update-ccache-symlinks

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: npm ci
run: npm ci --ignore-scripts

- name: Prepare ccache
run: ccache --clear --set-config cache_dir=~/.ccache

- name: Cache ccache
uses: actions/cache@v2
env:
cache-name: ccache-v1
with:
path: ~/.ccache
key: ${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}-${{ github.head_ref }}
restore-keys: |
${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}
${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}-${{ github.ref }}
${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}

- name: Clear ccache statistics
run: |
ccache --zero-stats --set-config cache_dir=~/.ccache
ccache --max-size=2G --set-config cache_dir=~/.ccache
ccache --show-stats --set-config cache_dir=~/.ccache

- name: CMake
if: runner.os == 'macOS'
run: |
cmake . -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} -DMBGL_WITH_COVERAGE=ON
sed -i -e 's/$(ARCHS_STANDARD)/x86_64/g' build/build.ninja
sed -i -e 's/-arch arm64e/-arch x86_64/g' build/build.ninja

- name: CMake
if: runner.os == 'Linux'
run: |
cmake . -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10

- name: Build
run: |
cmake --build build -j $(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null)

- name: Test
if: runner.os == 'Linux'
run: xvfb-run --auto-servernum npm test

- name: Test
if: runner.os == 'macOS'
run: npm test

- name: Pack
if: github.ref != 'refs/heads/main'
run: |
npm pack --dry-run

- name: Publish Release to Github
if: github.ref == 'refs/heads/main'
run: |
npm run package
npm run release
env:
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.CR_PAT }}

- name: Publish to NPM (release)
if: matrix.os == 'ubuntu-20.04' && matrix.node == '18' && github.ref == 'refs/heads/main' && github.event.inputs.version != 'prerelease'
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
npm publish --access public
env:
NPM_TOKEN: ${{ secrets.NPM_ORG_TOKEN }}

- name: Publish to NPM (prerelease)
if: matrix.os == 'ubuntu-20.04' && matrix.node == '18' && github.ref == 'refs/heads/main' && github.event.inputs.version == 'prerelease'
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
npm publish --tag next --access public
env:
NPM_TOKEN: ${{ secrets.NPM_ORG_TOKEN }}

Loading