From 9f883a501965d2e130f57c441a17f3a82fb3f6ac Mon Sep 17 00:00:00 2001 From: jfrazx Date: Fri, 14 Mar 2025 19:43:09 -0700 Subject: [PATCH] ci: update actions --- .github/workflows/close_blank_issues.yaml | 6 +++--- .github/workflows/codeql.yml | 2 +- .github/workflows/docker-build.yml | 21 ++++++++++----------- .github/workflows/i18n-integration.yml | 3 ++- .github/workflows/integration-test.yml | 9 +++++---- .github/workflows/lint-openapi.yml | 7 +++++++ .github/workflows/unit-tests.yml | 1 + 7 files changed, 29 insertions(+), 20 deletions(-) diff --git a/.github/workflows/close_blank_issues.yaml b/.github/workflows/close_blank_issues.yaml index c7108827..7190546a 100644 --- a/.github/workflows/close_blank_issues.yaml +++ b/.github/workflows/close_blank_issues.yaml @@ -14,11 +14,11 @@ jobs: steps: - name: Check issue headings - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | const issueBody = context.payload.issue.body || ""; - + // Match Markdown headings (e.g., # Heading, ## Heading) const headingRegex = /^(#{1,6})\s.+/gm; const headings = [...issueBody.matchAll(headingRegex)]; @@ -39,4 +39,4 @@ jobs: issue_number: context.payload.issue.number, state: "closed" }); - } \ No newline at end of file + } diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8d43311b..2e5f4bce 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -43,7 +43,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 846a5563..63735503 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -1,5 +1,4 @@ --- - name: Build and Push Docker Image on: @@ -11,7 +10,7 @@ on: required: true default: 'latest' push: - branches: [main,master] + branches: [main, master] tags: - 'v*.*.*' # Only build when files in these directories have been changed @@ -23,16 +22,16 @@ on: jobs: build: - if: "!contains(github.event.head_commit.message, 'skip ci')" + if: "!contains(github.event.head_commit.message, 'skip ci') && ${{ github.repository == 'advplyr/audiobookshelf' }}" runs-on: ubuntu-20.04 steps: - name: Check out - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Docker meta id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: advplyr/audiobookshelf,ghcr.io/${{ github.repository_owner }}/audiobookshelf tags: | @@ -40,13 +39,13 @@ jobs: type=semver,pattern={{version}} - name: Setup QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Cache Docker layers - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ github.sha }} @@ -54,20 +53,20 @@ jobs: ${{ runner.os }}-buildx- - name: Login to Dockerhub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: Login to ghcr - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GHCR_PASSWORD }} - name: Build image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 with: tags: ${{ github.event.inputs.tags || steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/i18n-integration.yml b/.github/workflows/i18n-integration.yml index fc844154..8b3a4678 100644 --- a/.github/workflows/i18n-integration.yml +++ b/.github/workflows/i18n-integration.yml @@ -20,7 +20,8 @@ jobs: - name: Set up node uses: actions/setup-node@v4 with: - node-version: '20' + node-version: 20 + cache: 'npm' # The only argument is the `directory`, which is where the i18n files are # stored. diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 580c0f50..18c1d2da 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -18,14 +18,15 @@ jobs: name: build and test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: setup nade - uses: actions/setup-node@v3 + - name: setup node + uses: actions/setup-node@v4 with: node-version: 20 + cache: 'npm' - - name: install pkg (using yao-pkg fork for targetting node20) + - name: install pkg (using yao-pkg fork for targeting node20) run: npm install -g @yao-pkg/pkg - name: get client dependencies diff --git a/.github/workflows/lint-openapi.yml b/.github/workflows/lint-openapi.yml index 817e94b9..ec08ecb3 100644 --- a/.github/workflows/lint-openapi.yml +++ b/.github/workflows/lint-openapi.yml @@ -18,15 +18,22 @@ jobs: # Check out the repository - name: Checkout uses: actions/checkout@v4 + # Set up node to run the javascript - name: Set up node uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + # Install Redocly CLI - name: Install Redocly CLI run: npm install -g @redocly/cli@latest + # Perform linting for exploded spec - name: Run linting for exploded spec run: redocly lint docs/root.yaml --format=github-actions + # Perform linting for bundled spec - name: Run linting for bundled spec run: redocly lint docs/openapi.json --format=github-actions diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 695696c6..91a22c71 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -29,6 +29,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 + cache: 'npm' - name: Install dependencies run: npm ci