Skip to content

Commit

Permalink
[ci] Use GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed May 1, 2021
1 parent 1a1d9b1 commit a85ab9a
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 84 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CI

on:
- push
- pull_request

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node:
- 10
- 12
- 14
os:
- macOS-latest
- ubuntu-16.04
- windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- run: npm install
- run: npm test
- run: npm run prebuild
if: matrix.node == 14 && startsWith(github.ref, 'refs/tags/')
- run: npm run prebuild-ia32
if:
matrix.node == 14 && matrix.os == 'windows-latest' &&
startsWith(github.ref, 'refs/tags/')
- run: npm run prebuild-linux-arm
if:
matrix.node == 14 && matrix.os == 'ubuntu-16.04' &&
startsWith(github.ref, 'refs/tags/')
- uses: actions/upload-artifact@v2
if: matrix.node == 14 && startsWith(github.ref, 'refs/tags/')
with:
name: ${{ matrix.os }}
path: prebuilds
release:
if: startsWith(github.ref, 'refs/tags/')
needs: test
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
path: prebuilds
- run: echo ::set-output name=version::$(git describe --tags)
id: get_version
- run:
tar -cvf "${{ steps.get_version.outputs.version }}-darwin-x64.tar" -C
"prebuilds/macOS-latest" .
- run:
tar -cvf "${{ steps.get_version.outputs.version }}-linux-arm.tar" -C
"prebuilds/ubuntu-16.04" linux-arm
- run:
tar -cvf "${{ steps.get_version.outputs.version }}-linux-arm64.tar" -C
"prebuilds/ubuntu-16.04" linux-arm64
- run:
tar -cvf "${{ steps.get_version.outputs.version }}-linux-x64.tar" -C
"prebuilds/ubuntu-16.04" linux-x64
- run:
tar -cvf "${{ steps.get_version.outputs.version }}-win32-ia32.tar" -C
"prebuilds/windows-latest" win32-ia32
- run:
tar -cvf "${{ steps.get_version.outputs.version }}-win32-x64.tar" -C
"prebuilds/windows-latest" win32-x64
- uses: softprops/action-gh-release@v1
with:
files: ${{ steps.get_version.outputs.version }}-*.tar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66 changes: 0 additions & 66 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# utf-8-validate

[![Version npm](https://img.shields.io/npm/v/utf-8-validate.svg)](https://www.npmjs.com/package/utf-8-validate)
[![Build Status](https://travis-ci.com/websockets/utf-8-validate.svg?branch=master)](https://travis-ci.com/websockets/utf-8-validate)
[![Windows Build](https://ci.appveyor.com/api/projects/status/github/websockets/utf-8-validate?branch=master&svg=true)](https://ci.appveyor.com/project/lpinca/utf-8-validate)
[![Build Status](https://img.shields.io/github/workflow/status/websockets/utf-8-validate/CI/master?label=build)](https://github.com/websockets/utf-8-validate/actions?query=workflow%3ACI+branch%3Amaster)
[![Windows x86 Build](https://ci.appveyor.com/api/projects/status/github/websockets/utf-8-validate?branch=master&svg=true)](https://ci.appveyor.com/project/lpinca/utf-8-validate)

Check if a buffer contains valid UTF-8 encoded text.

Expand Down
15 changes: 0 additions & 15 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ environment:
- nodejs_version: "10"
platform:
- x86
- x64
matrix:
fast_finish: true
install:
Expand All @@ -17,17 +16,3 @@ test_script:
- node --version
- npm --version
- npm test
after_test:
- ps: If ($env:nodejs_version -eq "14") { npm run prebuild }
- ps: $env:ARTIFACT_NAME_PREFIX = if (Test-Path env:APPVEYOR_REPO_TAG_NAME) { $env:APPVEYOR_REPO_TAG_NAME } else { 'latest' }
artifacts:
- path: prebuilds
name: $(ARTIFACT_NAME_PREFIX)-win-$(PLATFORM)
deploy:
- provider: GitHub
artifact: /.*\.zip/
auth_token:
secure: hU+EdxPa5CzNrTpFfcx3DoA8ja+xfRq56JD0sEpt5f0ctd3Az8WSI9h+MgRXjlms
on:
appveyor_repo_tag: true
nodejs_version: "14"
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"install": "node-gyp-build",
"prebuild": "prebuildify --napi --strip",
"prebuild-linux-arm": "prebuildify-cross -i linux-armv6 -i linux-armv7 --napi --strip",
"prebuild-ia32": "prebuildify --arch=ia32 --napi --strip",
"prebuild-linux-arm": "prebuildify-cross -i linux-armv6 -i linux-armv7 -i linux-arm64 --napi --strip",
"test": "mocha"
},
"repository": {
Expand Down

0 comments on commit a85ab9a

Please sign in to comment.