diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml deleted file mode 100644 index aacb1761..00000000 --- a/.github/workflows/node.js.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Unit test, log code coverage, and build - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Run tests and build on Node - uses: actions/setup-node@v1 - with: - node-version: 14.x - - run: yarn install - - run: yarn test # generates coverage - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - - run: yarn run build diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml deleted file mode 100644 index 873620e6..00000000 --- a/.github/workflows/npm-publish.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Publish to NPM - -on: - release: - types: [published] - -jobs: - publish-npm: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 14.x - registry-url: https://registry.npmjs.org/ - - run: yarn install - - run: yarn test - - run: yarn run build - - run: echo ${{github.ref}} - - name: Release canary version - # The ref will be the tag name. Match against tags like - # "v1.0.0-canary.0". - if: ${{ contains(github.ref, '-canary.') }} - run: npm publish --tag canary - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - name: Release latest version - # Assume non-canary is latest. - if: ${{ !contains(github.ref, '-canary.') }} - run: npm publish - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..c4c1f0e3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,88 @@ +name: Release + +on: + push: + branches: + - main + - next + - next-major + - alpha + - beta + # N.x (maintenance release branches) + - '[0-9]+.x' + +concurrency: + group: release-${{ github.ref }} + +env: + NODE_VERSION: 16.x + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2.4.0 + + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v2.5.1 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'yarn' + + - name: Configure package manager + run: | + echo Configuring NPM_TOKEN globally for .npmrc + npm config set '//registry.npmjs.org/:_authToken' ${{ env.NPM_TOKEN }} + npm whoami + env: + NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} + + - name: Install dependencies + run: yarn install + + - name: Test + run: yarn test + + # TODO: [PLAT-1191] Re-enable once support for no comment + # - name: Report Coverage + # uses: reside-eng/code-coverage-action@v1 + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Build app + run: yarn build + + - name: Semantic Release + uses: cycjimmy/semantic-release-action@v2 + id: semantic + with: + branches: | + [ + '+([0-9])?(.{+([0-9]),x}).x', + 'main', + 'next', + 'next-major', + {name: 'beta', prerelease: true}, + {name: 'alpha', prerelease: true} + ] + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + notification: + if: always() + name: notification + needs: [publish] + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2.3.4 + + - uses: technote-space/workflow-conclusion-action@v2.2.2 + + - uses: reside-eng/workflow-status-notification-action@v1.0.0 + with: + current-status: ${{ env.WORKFLOW_CONCLUSION }} + slack-webhook: ${{ secrets.SLACK_WEBHOOK_PLATFORM_PROD }} + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml new file mode 100644 index 00000000..28b05da3 --- /dev/null +++ b/.github/workflows/verify.yml @@ -0,0 +1,45 @@ +name: Verify + +on: + pull_request: + branches: + - main + +concurrency: + group: verify-${{ github.head_ref }} + cancel-in-progress: true + +env: + NODE_VERSION: 14.x + +jobs: + build: + name: build + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Checkout code + uses: actions/checkout@v2.4.0 + + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v2.5.1 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'yarn' + + - name: Configure package manager + run: | + echo Configuring NPM_TOKEN globally for .npmrc + npm config set '//registry.npmjs.org/:_authToken' ${{ env.NPM_TOKEN }} + npm whoami + env: + NPM_TOKEN: ${{ secrets.NPM_READ_TOKEN }} + + - name: Install dependencies + run: yarn install + + - name: Test + run: yarn test + + - name: Build app + run: yarn build diff --git a/package.json b/package.json index 1a9e0fc8..06ae6bce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "next-firebase-auth", - "version": "0.14.3-alpha.0", + "name": "@side/next-firebase-auth", + "version": "0.0.0-development", "description": "Simple Firebase authentication for all Next.js rendering strategies", "keywords": [ "Next",