Switch CI to Github for main

This commit is contained in:
Dave Syer
2024-07-10 17:24:48 +01:00
parent c76872f24a
commit 5175a14ba1
4 changed files with 43 additions and 143 deletions

View File

@@ -4,23 +4,24 @@
name: Java CI with Maven
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
name: Build Pull Request
runs-on: ubuntu-latest
if: ${{ github.repository == 'spring-projects/spring-guice' }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
run: ./mvnw -B package

37
.github/workflows/push.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven Deploy
on:
push:
branches: [ main ]
jobs:
build:
name: Build and Deploy On Push
runs-on: ubuntu-latest
if: ${{ github.repository == 'spring-projects/spring-guice' }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Deploy with Maven
env:
spring_username: ${{ secrets.ARTIFACTORY_USERNAME }}
spring_password: ${{ secrets.ARTIFACTORY_PASSWORD }}
sonatype_username: ${{ secrets.SONATYPE_USERNAME }}
sonatype_password: ${{ secrets.SONATYPE_PASSWORD }}
signing_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
run: |
echo "${signing_key}" > private.asc
gpg --import --batch --no-tty private.asc
./mvnw -B deploy -s .mvn/settings.xml