name: Build on: [ push, pull_request ] jobs: build: runs-on: ${{ matrix.os }} strategy: matrix: os: - ubuntu-latest - macos-latest - windows-latest node_version: - 16 name: Node ${{ matrix.node_version }} on ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v2 with: fetch-depth: 0 - name: Build Reason run: "echo ref: ${{github.ref}} event: ${{github.event_name}}" - name: Setup Node.js environment uses: actions/setup-node@v2 with: node-version: ${{ matrix.node_version }} registry-url: 'https://registry.npmjs.org' - name: Install latest NPM run: npm install -g npm@7 - name: NPM install with caching uses: bahmutov/npm-install@v1 - name: Set Min Version uses: thefringeninja/action-minver@2.0.0-preview1 id: version with: minimum-major-minor: 2.0 tag-prefix: v - name: Build Version run: | npm install --global replace-in-files-cli echo "MINVERVERSIONOVERRIDE=${{steps.version.outputs.version}}" >> $GITHUB_ENV npm run version -- ${{steps.version.outputs.version}} replace-in-files --regex='\/(v?((\d+)\.(\d+)(\.(\d+))?)(?:-([\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*))?(?:\+([\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*))?)' --replacement=/${{steps.version.outputs.version}} packages/core/src/configuration/Configuration.ts replace-in-files --string='2.0.0-dev' --replacement=${{steps.version.outputs.version}} packages/*/package.json - name: Build run: npm run build - name: Lint run: npm run lint - name: Run Tests run: npm test - name: Publish Release Packages if: startsWith(github.ref, 'refs/tags/v') && matrix.os == 'ubuntu-latest' run: npm publish --workspaces --access public env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - name: Setup GitHub CI Node.js environment if: github.event_name != 'pull_request' && matrix.os == 'ubuntu-latest' uses: actions/setup-node@v2 with: node-version: ${{ matrix.node_version }} registry-url: 'https://npm.pkg.github.com' scope: '@exceptionless' - name: Push GitHub CI Packages if: github.event_name != 'pull_request' && matrix.os == 'ubuntu-latest' run: npm publish --workspaces --access public env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}