Skip to content

Commit a85ab9a

Browse files
committed
[ci] Use GitHub Actions
1 parent 1a1d9b1 commit a85ab9a

File tree

5 files changed

+79
-84
lines changed

5 files changed

+79
-84
lines changed

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
test:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
node:
13+
- 10
14+
- 12
15+
- 14
16+
os:
17+
- macOS-latest
18+
- ubuntu-16.04
19+
- windows-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: actions/setup-node@v2
23+
with:
24+
node-version: ${{ matrix.node }}
25+
- run: npm install
26+
- run: npm test
27+
- run: npm run prebuild
28+
if: matrix.node == 14 && startsWith(github.ref, 'refs/tags/')
29+
- run: npm run prebuild-ia32
30+
if:
31+
matrix.node == 14 && matrix.os == 'windows-latest' &&
32+
startsWith(github.ref, 'refs/tags/')
33+
- run: npm run prebuild-linux-arm
34+
if:
35+
matrix.node == 14 && matrix.os == 'ubuntu-16.04' &&
36+
startsWith(github.ref, 'refs/tags/')
37+
- uses: actions/upload-artifact@v2
38+
if: matrix.node == 14 && startsWith(github.ref, 'refs/tags/')
39+
with:
40+
name: ${{ matrix.os }}
41+
path: prebuilds
42+
release:
43+
if: startsWith(github.ref, 'refs/tags/')
44+
needs: test
45+
runs-on: ubuntu-16.04
46+
steps:
47+
- uses: actions/checkout@v2
48+
- uses: actions/download-artifact@v2
49+
with:
50+
path: prebuilds
51+
- run: echo ::set-output name=version::$(git describe --tags)
52+
id: get_version
53+
- run:
54+
tar -cvf "${{ steps.get_version.outputs.version }}-darwin-x64.tar" -C
55+
"prebuilds/macOS-latest" .
56+
- run:
57+
tar -cvf "${{ steps.get_version.outputs.version }}-linux-arm.tar" -C
58+
"prebuilds/ubuntu-16.04" linux-arm
59+
- run:
60+
tar -cvf "${{ steps.get_version.outputs.version }}-linux-arm64.tar" -C
61+
"prebuilds/ubuntu-16.04" linux-arm64
62+
- run:
63+
tar -cvf "${{ steps.get_version.outputs.version }}-linux-x64.tar" -C
64+
"prebuilds/ubuntu-16.04" linux-x64
65+
- run:
66+
tar -cvf "${{ steps.get_version.outputs.version }}-win32-ia32.tar" -C
67+
"prebuilds/windows-latest" win32-ia32
68+
- run:
69+
tar -cvf "${{ steps.get_version.outputs.version }}-win32-x64.tar" -C
70+
"prebuilds/windows-latest" win32-x64
71+
- uses: softprops/action-gh-release@v1
72+
with:
73+
files: ${{ steps.get_version.outputs.version }}-*.tar
74+
env:
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.travis.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# utf-8-validate
22

33
[![Version npm](https://img.shields.io/npm/v/utf-8-validate.svg)](https://www.npmjs.com/package/utf-8-validate)
4-
[![Build Status](https://travis-ci.com/websockets/utf-8-validate.svg?branch=master)](https://travis-ci.com/websockets/utf-8-validate)
5-
[![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)
4+
[![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)
5+
[![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)
66

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

appveyor.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ environment:
77
- nodejs_version: "10"
88
platform:
99
- x86
10-
- x64
1110
matrix:
1211
fast_finish: true
1312
install:
@@ -17,17 +16,3 @@ test_script:
1716
- node --version
1817
- npm --version
1918
- npm test
20-
after_test:
21-
- ps: If ($env:nodejs_version -eq "14") { npm run prebuild }
22-
- ps: $env:ARTIFACT_NAME_PREFIX = if (Test-Path env:APPVEYOR_REPO_TAG_NAME) { $env:APPVEYOR_REPO_TAG_NAME } else { 'latest' }
23-
artifacts:
24-
- path: prebuilds
25-
name: $(ARTIFACT_NAME_PREFIX)-win-$(PLATFORM)
26-
deploy:
27-
- provider: GitHub
28-
artifact: /.*\.zip/
29-
auth_token:
30-
secure: hU+EdxPa5CzNrTpFfcx3DoA8ja+xfRq56JD0sEpt5f0ctd3Az8WSI9h+MgRXjlms
31-
on:
32-
appveyor_repo_tag: true
33-
nodejs_version: "14"

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"scripts": {
77
"install": "node-gyp-build",
88
"prebuild": "prebuildify --napi --strip",
9-
"prebuild-linux-arm": "prebuildify-cross -i linux-armv6 -i linux-armv7 --napi --strip",
9+
"prebuild-ia32": "prebuildify --arch=ia32 --napi --strip",
10+
"prebuild-linux-arm": "prebuildify-cross -i linux-armv6 -i linux-armv7 -i linux-arm64 --napi --strip",
1011
"test": "mocha"
1112
},
1213
"repository": {

0 commit comments

Comments
 (0)