app-outlet/app-outlet

View on GitHub
.github/workflows/pipeline.yml

Summary

Maintainability
Test Coverage
name: Pipeline

on:
  push:
    branches:
      - main
    tags:
      - v*
  pull_request:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Fetch dependencies
        run: npm install

      - name: Lint
        run: npm run lint

      - name: Test
        run: npm run test:coverage

      - name: Upload code coverage report
        uses: paambaati/codeclimate-action@v3.0.0
        if: startsWith(github.ref, 'refs/tags/')
        env:
          CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
        with:
          coverageLocations: coverage/lcov.info:lcov

      - name: Generage changelog
        run: npx standard-changelog -r 2 -v -o CHANGELOG.txt
        if: startsWith(github.ref, 'refs/tags/')

      - name: Print changelog
        run: cat CHANGELOG.txt
        if: startsWith(github.ref, 'refs/tags/')

      - name: Build
        run: npm run build
        if: startsWith(github.ref, 'refs/tags/')

      - name: Deploy to releases
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: |
            release/App Outlet-*.AppImage
            release/app-outlet-*.tar.gz
            release/app-outlet_*_amd64.deb
            release/app-outlet-*.x86_64.rpm
          body_path: CHANGELOG.txt
          token: ${{ secrets.GITHUB_TOKEN }}