From 620f1d33e01e9891073432835d57de3c5d462936 Mon Sep 17 00:00:00 2001 From: Gajus Kuizinas Date: Wed, 18 Jan 2023 10:35:05 -0600 Subject: [PATCH] chore: add github workflow --- .github/workflows/feature.yaml | 29 ++++++++++++++++++++++ .github/workflows/main.yaml | 27 +++++++++++++++++++++ .gitignore | 12 +++++----- .releaserc | 10 ++++++++ .travis.yml | 44 ---------------------------------- package.json | 5 +++- 6 files changed, 76 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/feature.yaml create mode 100644 .github/workflows/main.yaml create mode 100644 .releaserc delete mode 100644 .travis.yml diff --git a/.github/workflows/feature.yaml b/.github/workflows/feature.yaml new file mode 100644 index 000000000..343279941 --- /dev/null +++ b/.github/workflows/feature.yaml @@ -0,0 +1,29 @@ +jobs: + test: + runs-on: ubuntu-latest + environment: release + name: Test + steps: + - name: setup repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: setup node.js + uses: actions/setup-node@v3 + with: + node-version: "18" + - run: npm ci + - run: npm run lint + - run: npm run test + - run: npm run build + timeout-minutes: 10 +name: Test and build +on: + pull_request: + branches: + - main + types: + - opened + - synchronize + - reopened + - ready_for_review diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 000000000..902e29be4 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,27 @@ +jobs: + test: + runs-on: ubuntu-latest + environment: release + name: Test + steps: + - name: setup repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: setup node.js + uses: actions/setup-node@v3 + with: + node-version: "18" + - run: npm ci + - run: npm run lint + - run: npm run test + - run: npm run build + - run: npx semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} +name: Test, build and release +on: + push: + branches: + - main diff --git a/.gitignore b/.gitignore index 13a28a141..c2575509b 100755 --- a/.gitignore +++ b/.gitignore @@ -7,14 +7,14 @@ pnpm-lock.yaml .* !.babelrc.json !.editorconfig -!.eslintrc.json !.eslintignore +!.eslintrc.json !.gitattributes +!.github !.gitignore +!.husky +!.ncurc.js !.npmignore !.README -!.travis.yml -!.ncurc.js -!.github -!.husky -!.vscode +!.releaserc +!.vscode \ No newline at end of file diff --git a/.releaserc b/.releaserc new file mode 100644 index 000000000..c1435faa0 --- /dev/null +++ b/.releaserc @@ -0,0 +1,10 @@ +{ + "branches": [ + "main" + ], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/github", + "@semantic-release/npm" + ] +} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 50f8c5b95..000000000 --- a/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -os: linux -dist: focal -language: node_js -node_js: - - "14.17.0" - - "16" - - "18" - - "19" -install: - - npm install --legacy-peer-deps -before_script: > - - node_version=$(node -v); - - if [ ${ESLINT} = "7" ]; then - if [ ${node_version:1:2} = "16" ]; then - npm install --legacy-peer-deps --engine-strict --no-save "eslint@${ESLINT}" eslint-config-canonical@32.1.0 eslint-plugin-mocha@9 - else - npm install --legacy-peer-deps --no-save "eslint@${ESLINT}" eslint-config-canonical@32.1.0 eslint-plugin-mocha@9 - fi - else - if [ ${node_version:1:2} = "16" ]; then - npm install --engine-strict --no-save "eslint@${ESLINT}" - npm run lint - npm run build - else - npm install --legacy-peer-deps --no-save "eslint@${ESLINT}" eslint-config-canonical@32.1.0 eslint-plugin-mocha@9 - fi - fi - -notifications: - email: false -script: - - npm run test -env: - jobs: - - ESLINT=7 - - ESLINT=8 -after_success: - - export NODE_ENV=production - - npm run build - - semantic-release -cache: - npm: false diff --git a/package.json b/package.json index ac7cd81cc..db20aed4a 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,9 @@ "@babel/register": "^7.18.9", "@es-joy/jsdoc-eslint-parser": "^0.17.0", "@hkdobrev/run-if-changed": "^0.3.1", + "@semantic-release/commit-analyzer": "^9.0.2", + "@semantic-release/github": "^8.0.7", + "@semantic-release/npm": "^9.0.2", "@typescript-eslint/parser": "^5.47.1", "babel-plugin-add-module-exports": "^1.0.4", "babel-plugin-istanbul": "^6.1.1", @@ -44,7 +47,7 @@ "nyc": "^15.1.0", "open-editor": "^3.0.0", "rimraf": "^3.0.2", - "semantic-release": "^19.0.5", + "semantic-release": "^20.0.2", "typescript": "^4.9.4" }, "engines": {