Merge pull request #91 from RobBrazier/renovate/lock-file-maintenance #738
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Build" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "*-*.*.*" | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: ${{ vars.ACTION_RUNNER || 'ubuntu-latest' }} | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install tools from mise | |
| uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 | |
| - name: Install calibre dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libegl1 libopengl0 libxcb-cursor0 | |
| - name: Download calibre sources | |
| run: just .calibre/source | |
| - name: Get calibre version | |
| id: calibre | |
| run: echo "version=$(cat .calibre/source/.version)" >> $GITHUB_OUTPUT | |
| - name: Install calibre | |
| run: sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin version=${{ steps.calibre.outputs.version }} | |
| - name: Cache uv | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
| with: | |
| path: ~/.cache/uv | |
| key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | |
| - name: Install the project | |
| run: just install | |
| - name: Run Unit Tests | |
| run: just test --cov-report xml --junitxml=xunit.xml -o junit_family=xunit2 | |
| - name: SonarQube Scan | |
| uses: SonarSource/sonarqube-scan-action@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602 # v6.0.0 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| build: | |
| runs-on: ${{ vars.ACTION_RUNNER || 'ubuntu-latest' }} | |
| needs: | |
| - test | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install tools from mise | |
| uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 | |
| - name: Cache uv | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
| with: | |
| path: ~/.cache/uv | |
| key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | |
| - name: Install the project | |
| run: just install | |
| - name: Build Plugins | |
| run: just build-all | |
| - name: Upload Plugin Artifacts | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: built-plugins | |
| path: | | |
| dist/*.zip | |
| release: | |
| runs-on: ${{ vars.ACTION_RUNNER || 'ubuntu-latest' }} | |
| needs: | |
| - build | |
| if: github.ref_type == 'tag' | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install tools from mise | |
| uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 | |
| - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 | |
| with: | |
| name: built-plugins | |
| path: ${{ github.workspace }}/dist | |
| - name: Generate Changelog and Release | |
| run: | | |
| bash scripts/release.sh "${GITHUB_REF#refs/tags/}" | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GITHUB_TOKEN: ${{ github.token }} | |
| GITHUB_REPO: ${{ github.repository }} |