Skip to content

Merge pull request #1428 from gocd/dependabot/npm_and_yarn/npm_and_ya… #811

Merge pull request #1428 from gocd/dependabot/npm_and_yarn/npm_and_ya…

Merge pull request #1428 from gocd/dependabot/npm_and_yarn/npm_and_ya… #811

name: Test and Release
on:
push:
branches: [ main ]
workflow_dispatch:
inputs:
prerelease:
description: 'The release should be an experimental release'
default: 'NO'
required: true
jobs:
test:
runs-on: ubuntu-latest
name: test (postgres-${{ matrix.postgres-version }})
strategy:
matrix:
# See https://endoflife.date/postgresql
postgres-version: [ "14", "15", "16", "17", "18" ]
fail-fast: false
services:
postgres:
image: postgres:${{ matrix.postgres-version }}
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 20s
--health-retries 10
ports:
- 5432:5432
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up JDK
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
java-version: 21
distribution: temurin
cache: gradle
- name: Set up NodeJS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24
cache: npm
- name: Test with Gradle
run: ./gradlew assemble check
env:
PGPASSWORD: postgres
githubRelease:
needs: test
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
java-version: 21
distribution: temurin
cache: gradle
- name: Set up NodeJS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24
cache: npm
- name: Build and release with Gradle
run: ./gradlew githubRelease
env:
GITHUB_USER: "gocd"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
PRERELEASE: "${{ github.event.inputs.prerelease }}"