diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce9ea171d..a4638e0d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,32 +1,34 @@ name: ci -on: [push, pull_request] +on: + push: + branches: ['*'] + pull_request: jobs: build: runs-on: ${{ matrix.os }} strategy: matrix: - node: [14] + node: ['16'] os: [macos-latest, ubuntu-latest, windows-latest] include: - - node: 12 + - node: '12' os: ubuntu-latest - - node: 16 + - node: '14' os: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node }} - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: node-version: ${{ matrix.node }} - - run: yarn + - run: yarn --frozen-lockfile - run: yarn build - run: yarn test:unit lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: - node-version: 14 - - run: yarn + node-version: '16' + - run: yarn --frozen-lockfile - run: yarn check:lint diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..557319967 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,21 @@ +name: publish +on: + push: + tags: ['v[0-9]+.[0-9]+.[0-9]+'] +jobs: + publish: + if: github.event.repository.fork == false + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '16' + registry-url: 'https://registry.npmjs.org' + - name: Set variables + id: vars + run: echo ::set-output name=version::"$(jq -r .version lerna.json)" + - run: yarn --frozen-lockfile + - run: yarn lerna publish ${{ steps.vars.outputs.version }} -y --no-git-tag-version --no-push --exact + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 292ee6c23..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Release new Electrode Native version - -on: - push: - tags: - - '*' - -jobs: - release-ern: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - - name: Install - run: yarn install - - name: Authenticate with Registry - run: | - yarn logout - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc - npm whoami - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Release - run: | - ERN_VERSION=$(cat lerna.json | jq .version) - echo "Releasing Electrode Native v${ERN_VERSION}" - lerna publish ${ERN_VERSION} --yes --no-git-tag-version --no-push --exact - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }}