Skip to content

AG-230 - Fix deprecation in github action #162

AG-230 - Fix deprecation in github action

AG-230 - Fix deprecation in github action #162

Workflow file for this run

name: Agroal CI
on:
push:
branches: '**'
pull_request:
schedule:
- cron: '0 5 * * 0' # at 05:00 on Sunday
jobs:
build:
name: Java 17 - Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
cache: 'maven'
distribution: 'temurin'
java-package: jdk
java-version: '17'
- run: mvn -B install
- uses: actions/upload-artifact@v4
with:
name: agroal-repository-artifact
path: ~/.m2/repository/io/agroal/**
retention-days: 1
test:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
java: [ 21, 17, 11 ]
name: Java ${{ matrix.java }} - Test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
cache: 'maven'
distribution: 'temurin'
java-package: jdk
java-version: ${{ matrix.java }}
- uses: actions/download-artifact@v4
with:
name: agroal-repository-artifact
path: ~/.m2/repository/io/agroal
# don't run spring tests on JVMs older than 17
- run: rm -fr agroal-test/src/test/java/io/agroal/test/springframework && mvn --projects agroal-test verify -Dversion.org.springframework.boot=2.6.1
deploy:
if: ${{ github.repository == 'barreiro/agroal' && github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
needs: [ build, test ]
name: Java 17 - Rebuild and Deploy Snapshot Artifacts
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
cache: 'maven'
distribution: 'temurin'
java-package: jdk
java-version: '17'
server-id: jboss-snapshots-repository
server-username: MAVEN_CI_USERNAME
server-password: MAVEN_CI_PASSWORD
- id: project
run: echo "PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> "$GITHUB_ENV"
- if: endsWith($env.PROJECT_VERSION, '-SNAPSHOT')

Check failure on line 68 in .github/workflows/maven-action.yml

View workflow run for this annotation

GitHub Actions / Agroal CI

Invalid workflow file

The workflow is not valid. .github/workflows/maven-action.yml (Line: 68, Col: 13): Unexpected symbol: '$env'. Located at position 10 within expression: endsWith($env.PROJECT_VERSION, '-SNAPSHOT')
run: mvn -B deploy
env:
MAVEN_CI_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_CI_PASSWORD: ${{ secrets.MAVEN_TOKEN }}