Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Jenkins with GH Actions #170

Merged
merged 2 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
jdk11:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven

- name: JDK 11 Tests
run: mvn -B verify -Dmaven.test.failure.ignore=true -Dansi.strip=true

- name: Test Results
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: JDK 17 Test Results
path: "**/target/*-reports*/**/TEST-*.xml"
reporter: java-junit

jdk17:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: JDK 17 Tests
run: mvn -B verify -Dmaven.test.failure.ignore=true -Dansi.strip=true

- name: Test Results
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: JDK 17 Test Results
path: "**/target/*-reports*/**/TEST-*.xml"
reporter: java-junit
81 changes: 81 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Release

on:
workflow_dispatch:
inputs:
branch:
description: "The ProtoStream branch to checkout when cutting the release."
required: true
default: "main"
version:
description: "Release version"
required: true
nextVersion:
description: "Next version"
required: true

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout Source
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch }}

- name: Set release version
run: |
mvn -B versions:set -DnewVersion=${{ github.event.inputs.version }} -DprocessAllModules=true
mvn -B versions:set-property -Dproperty=version.infinispan -DnewVersion=${{ github.event.inputs.version }}

- name: Set up Java for publishing to OSSRH
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.INFINISPAN_MAVEN_GPG_ARMORED }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Publish to OSSRH
run: mvn -B clean deploy -Pcommunity-release -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.INFINISPAN_MAVEN_GPG_PASSPHRASE }}

- name: Configure Git User
run: |
git config user.email "[email protected]"
git config user.name "Infinispan"


- name: Tag Release
run: |
git commit -a -m "Releasing ${{ github.event.inputs.version }}"
git tag ${{ github.event.inputs.version }}

- name: Next Version
run: |
mvn -B versions:set -DnewVersion=${{ github.event.inputs.nextVersion }} -DprocessAllModules=true
mvn -B versions:set-property -Dproperty=version.infinispan -DnewVersion=${{ github.event.inputs.nextVersion }}
git commit -a -m "Next version ${{ github.event.inputs.developmentVersion }}"

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.event.inputs.branch }}
tags: true

- id: release
name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: ${{ github.event.inputs.version }}
100 changes: 0 additions & 100 deletions Jenkinsfile

This file was deleted.

93 changes: 0 additions & 93 deletions Jenkinsfile-release

This file was deleted.

9 changes: 5 additions & 4 deletions parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@
<maven.releases.repo.url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</maven.releases.repo.url>
<maven.snapshots.repo.id>ossrh</maven.snapshots.repo.id>
<maven.snapshots.repo.url>https://s01.oss.sonatype.org/content/repositories/snapshots</maven.snapshots.repo.url>

<infinispan.gpg.key>9E31AB27445478DB</infinispan.gpg.key>
</properties>

<repositories>
Expand Down Expand Up @@ -392,8 +390,11 @@
<goal>sign</goal>
</goals>
<configuration>
<keyname>${infinispan.gpg.key}</keyname>
<passphraseServerId>${infinispan.gpg.key}</passphraseServerId>
<passphraseServerId>gpg.passphrase</passphraseServerId>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
Expand Down