Skip to content

Commit

Permalink
Updating actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihxil committed Jan 23, 2023
1 parent 5462b8e commit bbdb40c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 42 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,7 @@ jobs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-
if: always()
- uses: actions/checkout@v3
- uses: oleksiyrudenko/[email protected]
with:
global: true
Expand All @@ -25,8 +17,8 @@ jobs:
token: '${{ secrets.GITHUB_TOKEN }}'
- name: Release branch with Maven
run: |
VERSION=`mvn help:evaluate -Dexpression=project.version -q -DforceStdout`
VERSION=`mvn help:evaluate -ntp -Dexpression=project.version -q -DforceStdout`
RELEASE_VERSION=`echo $VERSION | sed -r 's/-SNAPSHOT/.0-SNAPSHOT/'`
DEVELOPMENT_VERSION=`echo $VERSION | gawk 'match($1, /([0-9]+)\.([0-9]+)([\.-])(.*)/, a) {print a[1]"."(a[2]+1)a[3]a[4]}'`
mvn -DupdateBranchVersions=true -DreleaseVersion=${RELEASE_VERSION} -DdevelopmentVersion=${DEVELOPMENT_VERSION} release:branch
mvn -ntp -DupdateBranchVersions=true -DreleaseVersion=${RELEASE_VERSION} -DdevelopmentVersion=${DEVELOPMENT_VERSION} release:branch
8 changes: 3 additions & 5 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ jobs:
build:

runs-on: ubuntu-latest
env:
MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
distribution: 'temurin'
Expand All @@ -34,7 +32,7 @@ jobs:
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }}
gpg-passphrase: GPG_SECRET_KEY_PASSPHRASE
- name: Build with Maven
run: mvn -fae -DskipITs=false -DskipTests=${skipTests} -U -B -Pdeploy,sonatype deploy -Dgpg.skip=false
run: mvn -ntp -fae -DskipITs=false -DskipTests=${skipTests} -U -B -Pdeploy,sonatype deploy -Dgpg.skip=false
env:
SONATYPE_USERNAME: vpro
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
Expand All @@ -43,7 +41,7 @@ jobs:
uses: codecov/codecov-action@v3
continue-on-error: true
- name: Publish Test Report
uses: EnricoMi/publish-unit-test-result-action/composite@v2.2.0
uses: EnricoMi/publish-unit-test-result-action/composite@v2.3.0
with:
junit_files: "**/target/surefire-reports/*.xml"
if: always()
14 changes: 5 additions & 9 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,18 @@ name: build pull request

on:
pull_request:
branches: [master]
branches: [main]

jobs:
build:

runs-on: ubuntu-latest
env:
MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
steps:
- uses: getong/[email protected]
with:
elasticsearch version: '7.6.1'
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 1.8
distribution: 'temurin'
java-version: 17
cache: maven
- name: Build with Maven
run: mvn -fae -DskipITs=false -Dinteg.cluster.name=docker-elasticsearch -B package
run: mvn -ntp -fae -DskipITs=false -Dinteg.cluster.name=docker-elasticsearch -B package
29 changes: 12 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,26 @@ jobs:
steps:
- name: echo
run: echo {{ $github.ref }}
- uses: actions/checkout@v2
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
- name: Create settings.xml
uses: s4u/maven-settings-action@v2
with:
servers: '[{"id": "vpro-ossrh", "username": "vpro", "password": "${{secrets.SONATYPE_PASSWORD}}"}]'
- uses: crazy-max/ghaction-import-gpg@v3
with:
java-version: 17
cache: maven
server-id: vpro-ossrh
server-username: SONATYPE_USERNAME
server-password: SONATYPE_PASSWORD
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }}
passphrase: ${{ secrets.GPG_SECRET_KEY_PASSPHRASE }}
gpg-passphrase: GPG_SECRET_KEY_PASSPHRASE
- uses: oleksiyrudenko/[email protected]
with:
global: true
name: 'github'
email: '[email protected]'
token: '${{ secrets.GITHUB_TOKEN }}'
- name: Release
run: mvn -Pdeploy --batch-mode -Darguments=-DskipTests release:prepare release:perform
run: mvn -ntp -Pdeploy --batch-mode -Darguments=-DskipTests release:prepare release:perform
env:
SONATYPE_USERNAME: vpro
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_SECRET_KEY_PASSPHRASE: ${{ secrets.GPG_SECRET_KEY_PASSPHRASE }}

0 comments on commit bbdb40c

Please sign in to comment.