diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index decd127..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build -on: - push: - branches: - - main -jobs: - build: - name: Build - runs-on: ubuntu-latest - if: github.repository_owner == 'alfasoftware' - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 17 - - name: Cache SonarCloud packages - uses: actions/cache@v3 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - name: Cache Maven packages - uses: actions/cache@v3 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - name: Build and analyze - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: mvn -B verify # org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -X -Pcoverage diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9fc1e71 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +name: CI + +on: + push: + branches: [main] + tags: ['*'] + pull_request: + branches: [main] + +jobs: + test: + name: Test + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + cache: 'maven' + + - name: Run tests + run: mvn clean verify + + deploy: + name: Deploy + runs-on: ubuntu-latest + if: github.event_name == 'push' && github.repository_owner == 'alfasoftware' + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + cache: 'maven' + + - name: Import GPG keys + run: | + echo "$GPG_SECRET_KEYS" | base64 --decode | gpg --batch --import + echo "$GPG_OWNERTRUST" | base64 --decode | gpg --batch --import-ownertrust + env: + GPG_SECRET_KEYS: ${{ secrets.GPG_SECRET_KEYS }} + GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }} + + - name: Deploy to Maven Central + run: mvn clean deploy --settings .maven-settings.xml -B -U -Prelease diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 95a2bd8..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Publish package to the Maven Central Repository -on: - push: -# release: -# types: [edited] -jobs: - release: - name: "Deploy" - runs-on: ubuntu-latest - steps: - - name: Check out Git repository - uses: actions/checkout@v2 - - - name: Install Java and Maven - uses: actions/setup-java@v1 - with: - java-version: 17 - -# - name: foo -# run: echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust -# - name: bar -# run: echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import - - name: "Maven Deploy" - run: mvn clean deploy --settings .maven-settings.xml -B -U -Prelease diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml deleted file mode 100644 index 4fbd7a0..0000000 --- a/.github/workflows/pr-build.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Build -on: - pull_request: - types: [opened, synchronize, reopened] -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 17 - uses: actions/setup-java@v1 - with: - java-version: 17 - - name: Cache Maven packages - uses: actions/cache@v3 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - name: Build and analyze - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - run: mvn clean verify diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 87b4393..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: java -dist: noble -jdk: openjdk21 -jobs: - include: - - if: repo = alfasoftware/astra AND head_repo = alfasoftware/astra AND type = pull_request - name: "Test" - script: - - git fetch --quiet - - mvn clean verify - - if: repo = alfasoftware/astra AND (branch = main OR tag IS present) AND NOT type = pull_request - name: "Deploy" - script: - - echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --batch --import - - echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --batch --import-ownertrust - - mvn clean deploy --settings .maven-settings.xml -B -U -Prelease