diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml new file mode 100644 index 00000000..e7bc594a --- /dev/null +++ b/.github/workflows/node.yml @@ -0,0 +1,19 @@ +name: Node CI + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: lts/* + - name: Install npm dependencies + run: npm ci + - name: Run tests + run: npm test -- --ci + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2.1.0 diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml deleted file mode 100644 index 2bed875c..00000000 --- a/.github/workflows/nodejs.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Node CI - -on: [push] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v3 - with: - node-version: lts/* - - name: npm install - run: npm install - env: - CI: true - - name: npm test - run: npm test - env: - CI: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..24e7090a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: Release (Weekly on Tuesdays) + +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * 2" + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: lts/* + - name: Install npm dependencies + run: npm ci + - name: Lint + run: npm run lint + - name: Run tests + env: + FORCE_COLOR: 1 + run: npm test -- --ci + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npx semantic-release diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml deleted file mode 100644 index 95373dd3..00000000 --- a/.github/workflows/semantic-release.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Semantic Release - -on: - push: - branches: - - master - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v3 - with: - node-version: lts/* - - run: npm ci - - run: npm test - - publish: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v3 - with: - node-version: lts/* - registry-url: https://registry.npmjs.org/ - - run: npx semantic-release - env: - NPM_TOKEN: ${{secrets.NPM_TOKEN}} - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - GH_TOKEN: ${{secrets.GH_TOKEN}} - # publish-gpr: - # needs: build - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v1 - # - uses: actions/setup-node@v1 - # with: - # node-version: 12 - # registry-url: https://npm.pkg.github.com/ - # scope: '@keplersj' - # - run: npm publish - # env: - # NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}