name: Tagged Test Builds

on:
  push:
    tags:
      - 'v[0-9].[0-9]+.[0-9]+-alpha'
      - 'v[0-9].[0-9]+.[0-9]+-beta'

jobs:
  all_jobs:
    name: Tests, Builds, Coverage, Release Uploads
    runs-on: ubuntu-latest
    steps:
    - name: Checkout Commit
      uses: actions/checkout@v2
    - name: Use Node.js 13.x
      uses: actions/setup-node@v1
      with:
        node-version: '13.x'
    - name: Cache Node.js
      uses: actions/cache@v1
      with:
        path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
        key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
        restore-keys: |
          ${{ runner.OS }}-node-
          ${{ runner.OS }}
    - name: Install Dependencies (npm ci)
      run: npm ci
    - name: Run Tests
      run: npm run test -- --verbose
    - name: Run TSLint
      run: npm run lint
    - name: Ensure Version is Updated
      run: node ./tools/replaceVersionNumber.js
    - name: Run Build
      run: npm run build
    - name: Coveralls.io Coverage Upload
      uses: coverallsapp/github-action@v1.0.1
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
    - name: GitHub Releases
      id: github_releases
      uses: softprops/action-gh-release@v1
      if: startsWith(github.ref, 'refs/tags/')
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        files: |
          builds/Cookie-AutoDelete_*_Chrome.zip
          builds/Cookie-AutoDelete_*_Firefox.xpi
        body: This is an automatically generated build based on the tag pushed.  See commits for changes.
        prerelease: true

Add new CI Test builds for auto prerelease builds
Add new CI Test builds for auto prerelease builds

Signed-off-by: Kenneth Tran <5631b657362aa3109b5e1f275296f232628c174d@users.noreply.github.com>
