From f8fff948b4ea1d7516948ab37a2d65ec20e03248 Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Sun, 1 Aug 2021 13:41:11 +0200 Subject: [PATCH] Move to GitHub Actions (#764) Ref Level/community#99 Bumps prebuildify-cross from 4.0.0 to 4.0.1 Ref https://github.com/prebuild/prebuildify-cross/pull/9 --- .github/dependabot.yml | 4 ++ .github/workflows/release.yml | 76 +++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 41 +++++++++++++++++++ .travis.yml | 66 ------------------------------ CHANGELOG.md | 4 +- README.md | 10 ++--- appveyor.yml | 42 ------------------- package.json | 10 ++--- 8 files changed, 133 insertions(+), 120 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8f9a8c67..29c1d3e1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,3 +7,7 @@ updates: ignore: - dependency-name: dependency-check - dependency-name: node-gyp + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..3c005b14 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,76 @@ +name: Release +on: + push: + tags: ['*'] +jobs: + build: + permissions: + contents: read + strategy: + matrix: + include: + - os: ubuntu-latest + arch: x64 + build-group: linux-x64 + - os: ubuntu-latest + arch: x64 + build-group: linux-arm + - os: ubuntu-latest + arch: x64 + build-group: android-arm + - os: macos-latest + arch: x64 + build-group: darwin-x64 + - os: windows-latest + arch: x86 + build-group: win32-x86 + - os: windows-latest + arch: x64 + build-group: win32-x64 + runs-on: ${{ matrix.os }} + name: Build ${{ matrix.build-group }} + env: + BUILD_GROUP: ${{ matrix.build-group }} + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: recursive + - name: Set up node + uses: actions/setup-node@v2 + with: + node-version: 14 + architecture: ${{ matrix.arch }} + - name: Install + run: npm install --ignore-scripts + - name: Prebuild + run: npm run prebuild-$BUILD_GROUP + shell: bash + - name: Prepare artifact + run: tar -zcvf $BUILD_GROUP.tar.gz -C prebuilds . + shell: bash + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ env.BUILD_GROUP }} + path: ${{ env.BUILD_GROUP }}.tar.gz + retention-days: 1 + release: + needs: build + permissions: + contents: write + runs-on: ubuntu-latest + name: Release + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + path: artifacts + - name: Create GitHub release + uses: docker://antonyurchenko/git-release:v4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + args: artifacts/*/*.tar.gz diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..bf1a332e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,41 @@ +name: Test +on: [push, pull_request] +permissions: + contents: read +jobs: + test: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + node: [10, 12, 14] + arch: [x86, x64] + exclude: + - { os: ubuntu-latest, arch: x86 } + - { os: macos-latest, arch: x86 } + runs-on: ${{ matrix.os }} + name: ${{ matrix.os }} / Node ${{ matrix.node }} ${{ matrix.arch }} + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: recursive + - name: Use node ${{ matrix.node }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + architecture: ${{ matrix.arch }} + - name: Install + run: npm install + - name: Test + run: npm test + - name: Coverage + run: npm run coverage + - name: Codecov + uses: codecov/codecov-action@v1 + with: + file: coverage/lcov.info + - name: Test Electron + if: ${{ matrix.node == '14' }} + uses: GabrielBB/xvfb-action@v1 + with: + run: npm run test-electron diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index be126be8..00000000 --- a/.travis.yml +++ /dev/null @@ -1,66 +0,0 @@ -language: node_js - -jobs: - include: - - os: linux - node_js: 10 - env: [TEST=1] - - os: linux - node_js: 12 - env: [TEST=1] - - os: linux - node_js: 14 - env: [TEST=1] - - os: linux - node_js: node - env: [TEST=1, TEST_ELECTRON=1, BUILD_GROUP=linux-x64] - addons: - apt: - packages: - - xvfb - before_script: - - export DISPLAY=':99.0' - - Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - - os: osx - node_js: 10 - env: [TEST=1] - - os: osx - node_js: 12 - env: [TEST=1] - - os: osx - node_js: 14 - env: [TEST=1] - - os: osx - node_js: node - env: [TEST=1, TEST_ELECTRON=1, BUILD_GROUP=darwin-x64] - - name: arm - os: linux - node_js: node - env: [BUILD_GROUP=arm, NPM_CONFIG_IGNORE_SCRIPTS=1] - if: tag is present - -script: - - if [[ ! -z "$TEST" ]]; then npm run test; fi - - if [[ ! -z "$TEST_ELECTRON" ]]; then npm run test-electron; fi - -after_success: - - if [[ ! -z "$TEST" ]]; then npm run coverage; fi - -before_deploy: - - export ARCHIVE_NAME="${TRAVIS_TAG:-latest}-$BUILD_GROUP.tar.gz" - - NPM_CONFIG_IGNORE_SCRIPTS= npm run prebuild-$BUILD_GROUP - - file prebuilds/*/* - - tar -zcvf "$ARCHIVE_NAME" -C prebuilds . - -deploy: - provider: releases - draft: false - api_key: "$PREBUILD_TOKEN" - file: "$ARCHIVE_NAME" - skip_cleanup: true - on: - tags: true - condition: "! -z $BUILD_GROUP" - -notifications: - email: false diff --git a/CHANGELOG.md b/CHANGELOG.md index ee8a1e8e..b7d1eed0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1094,7 +1094,7 @@ _**If you are upgrading:** please see [`UPGRADING.md`](UPGRADING.md)._ - Callback is not optional for `.close()` ([**@rvagg**](https://github.com/rvagg)) -## 0.0.0 - 2013-01-06 +## [0.0.0] - 2013-01-06 :seedling: First release. Extracted from `levelup` as a stand-alone package ([**@rvagg**](https://github.com/rvagg)) @@ -1289,3 +1289,5 @@ _**If you are upgrading:** please see [`UPGRADING.md`](UPGRADING.md)._ [0.0.2]: https://github.com/Level/leveldown/compare/0.0.1...0.0.2 [0.0.1]: https://github.com/Level/leveldown/compare/0.0.0...0.0.1 + +[0.0.0]: https://github.com/Level/leveldown/releases/tag/0.0.0 diff --git a/README.md b/README.md index 7d7521fb..461c5a8e 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,10 @@ [![level badge][level-badge]](https://github.com/Level/awesome) [![npm](https://img.shields.io/npm/v/leveldown.svg?label=&logo=npm)](https://www.npmjs.com/package/leveldown) [![Node version](https://img.shields.io/node/v/leveldown.svg)](https://www.npmjs.com/package/leveldown) -[![Travis](https://img.shields.io/travis/com/Level/leveldown.svg?logo=travis&label=)](https://travis-ci.com/Level/leveldown) -[![AppVeyor](https://img.shields.io/appveyor/ci/Level/leveldown.svg?logo=appveyor&label=)](https://ci.appveyor.com/project/Level/leveldown) +[![Test](https://github.com/Level/leveldown/actions/workflows/test.yml/badge.svg)](https://github.com/Level/leveldown/actions/workflows/test.yml) [![Cirrus CI](https://img.shields.io/cirrus/github/Level/leveldown?logo=cirrus-ci&label=)](https://cirrus-ci.com/github/Level/leveldown) [![npm](https://img.shields.io/npm/dm/leveldown.svg?label=dl)](https://www.npmjs.com/package/leveldown) -[![Coverage Status](https://coveralls.io/repos/github/Level/leveldown/badge.svg)](https://coveralls.io/github/Level/leveldown) +[![Coverage Status](https://codecov.io/gh/Level/leveldown/branch/master/graph/badge.svg)](https://codecov.io/gh/Level/leveldown) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![Backers on Open Collective](https://opencollective.com/level/backers/badge.svg?color=orange)](#backers) [![Sponsors on Open Collective](https://opencollective.com/level/sponsors/badge.svg?color=orange)](#sponsors) @@ -487,12 +486,11 @@ $ git submodule update --init --recursive 1. Increment the version: `npm version ..` 2. Push to GitHub: `git push --follow-tags` -3. Wait for Travis and AppVeyor builds to complete +3. Wait for CI to complete 4. Download prebuilds into `./prebuilds`: `npm run download-prebuilds` 5. Optionally verify loading a prebuild: `npm run test-prebuild` 6. Optionally verify which files npm will include: `canadian-pub` -7. Add changelog to the GitHub release -8. Finally: `npm publish` +7. Finally: `npm publish` ## Donate diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 7b26c997..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,42 +0,0 @@ -build: false -skip_branch_with_pr: true - -environment: - matrix: - - nodejs_version: "10" - - nodejs_version: "12" - - nodejs_version: "Current" - -configuration: Release -platform: - - x64 - - x86 - -install: - - SET PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin;%PATH% - - ps: Install-Product node $env:nodejs_version $env:platform - - SET PATH=%APPDATA%\npm;%APPVEYOR_BUILD_FOLDER%\node_modules\.bin;%PATH% - - git submodule update --init --recursive - - npm i - -test_script: - - node --version - - npm --version - - npm test - - ps: if ($env:nodejs_version -eq "Current") { npm run test-electron } - -before_deploy: - - SET ARCHIVE_NAME=%APPVEYOR_REPO_TAG_NAME%-win32-%PLATFORM%.tar.gz - - npm run prebuild - - tar -zcvf "%ARCHIVE_NAME%" -C prebuilds . - - appveyor PushArtifact %ARCHIVE_NAME% - -deploy: - - provider: GitHub - artifact: $(ARCHIVE_NAME) - auth_token: - secure: Oe6B6Pf/inZ0I5Ta2HVEMg8PAfwi95EtfvTKKMAvFdUPXF//sExugRdATtnMFiwu - draft: false - on: - appveyor_repo_tag: true - nodejs_version: "Current" diff --git a/package.json b/package.json index c565fc79..527c97d1 100644 --- a/package.json +++ b/package.json @@ -10,18 +10,19 @@ "test-gc": "node --expose-gc test/gc.js", "test-electron": "electron test/electron.js", "test-prebuild": "cross-env PREBUILDS_ONLY=1 npm t", - "coverage": "nyc report --reporter=text-lcov | coveralls", + "coverage": "nyc report -r lcovonly", "rebuild": "npm run install --build-from-source", "prebuild": "prebuildify -t 8.14.0 --napi --strip", "download-prebuilds": "prebuildify-ci download", "hallmark": "hallmark --fix", "dependency-check": "dependency-check --no-dev -i napi-macros . test/*.js", "prepublishOnly": "npm run dependency-check", - "prebuild-arm": "npm run prebuild-linux-arm && npm run prebuild-android-arm", "prebuild-linux-arm": "prebuildify-cross -i linux-armv6 -i linux-armv7 -i linux-arm64 -t 8.14.0 --napi --strip", "prebuild-android-arm": "prebuildify-cross -i android-armv7 -i android-arm64 -t 8.14.0 --napi --strip", "prebuild-linux-x64": "prebuildify-cross -i centos7-devtoolset7 -i alpine -t 8.14.0 --napi --strip", - "prebuild-darwin-x64": "prebuildify -t 8.14.0 --napi --strip" + "prebuild-darwin-x64": "prebuildify -t 8.14.0 --napi --strip", + "prebuild-win32-x86": "prebuildify -t 8.14.0 --napi --strip", + "prebuild-win32-x64": "prebuildify -t 8.14.0 --napi --strip" }, "dependencies": { "abstract-leveldown": "^7.0.0", @@ -30,7 +31,6 @@ }, "devDependencies": { "async-each": "^1.0.3", - "coveralls": "^3.0.2", "cross-env": "^7.0.3", "delayed": "^2.0.0", "dependency-check": "^4.1.0", @@ -46,7 +46,7 @@ "nyc": "^15.0.0", "prebuildify": "^4.1.0", "prebuildify-ci": "^1.0.4", - "prebuildify-cross": "^4.0.0", + "prebuildify-cross": "^4.0.1", "readfiletree": "^1.0.0", "rimraf": "^3.0.0", "standard": "^16.0.3",