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

Get the package into a working state again #1705

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
52 changes: 52 additions & 0 deletions .github/workflows/publish.yml
@@ -0,0 +1,52 @@
name: Publish
on:
schedule:
- cron: '0 0 * * *'
pull_request:
jobs:
release:
name: Packages
if: github.repository == 'protobufjs/protobuf.js'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
ref: master
- uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install dependencies
run: |
npm -v
npm install
cd cli
npm install
npm install .. --no-save
cd ..
- name: Build packages
run: |
VERSION=$(npx aspublish --version)
if [[ "$VERSION" == "" ]]; then
echo "Changes do not trigger a release"
else
echo "Building version: $VERSION"
npm version "$VERSION" --no-git-tag-version
npm run build
npm test
cd cli
npm version "$VERSION" --no-git-tag-version
cd ..
fi
- name: Publish packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
if [ $(node -pe "require('./package.json').version") != "0.0.0" ]; then
echo "npx aspublish"
fi
cd cli
if [ $(node -pe "require('./package.json').version") != "0.0.0" ]; then
echo "npm publish"
fi
cd ..
88 changes: 0 additions & 88 deletions .github/workflows/release-submodule.yaml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/release.yaml

This file was deleted.

72 changes: 39 additions & 33 deletions .github/workflows/test.yml
Expand Up @@ -9,53 +9,59 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: "12"
- name: "Install dependencies"
run: npm install
- name: "Lint sources"
node-version: "lts/*"
- name: Install dependencies
run: |
npm -v
npm install
cd cli
npm install
npm install .. --no-save
cd ..
- name: Lint sources
run: npm run lint:sources -- --max-warnings 0
- name: "Lint types"
- name: Lint types
run: npm run lint:types
build:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: "12"
- name: "Install dependencies"
run: npm install && (cd cli && npm install)
- name: "Build distribution files"
run: npm run build
test:
runs-on: ubuntu-latest
needs: build
needs: lint
strategy:
matrix:
node_version: ["4", "4.3.2", "6", "8", "10", "12"]
node_version: ["12", "14", "lts/*"]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
- name: "Install dependencies"
run: npm install
- name: "Test sources"
run: npm run test:sources
- name: "Test types"
run: npm run test:types
- name: Install dependencies
run: |
npm -v
npm install
cd cli
npm install
npm install .. --no-save
cd ..
- name: Build the package
run: npm run build
- name: Run all tests
run: npm test
bench:
runs-on: ubuntu-latest
needs: build
needs: lint
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: "12"
- name: "Install dependencies"
run: npm install
- name: "Run benchmark"
node-version: "lts/*"
- name: Install dependencies
run: |
npm -v
npm install
cd cli
npm install
npm install .. --no-save
cd ..
- name: Run benchmark
run: npm run bench
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -9,4 +9,4 @@ docs/
coverage/
sandbox/
.nyc_output

dist/