Skip to content

Generalized triggerDescriptorUpdate manipulation to multiple ReportParts. #276

Generalized triggerDescriptorUpdate manipulation to multiple ReportParts.

Generalized triggerDescriptorUpdate manipulation to multiple ReportParts. #276

Workflow file for this run

name: Build java package
on:
pull_request: # Apply to all pull requests
push: # Apply to all branches
env:
GRADLE_VERSION: 7.5.1
RELEASE_VERSION: 0
jobs:
build-java:
runs-on: ubuntu-latest
steps:
# Run `git checkout`
- uses: actions/checkout@v3
- name: Source dependency versions
working-directory: config
run: |
cat versions.txt >> $GITHUB_ENV
- name: Detect release version
if: startsWith(github.ref, 'refs/tags/v')
run: |
echo RELEASE_VERSION=1 >> $GITHUB_ENV
- name: Install Protoc
run: |
sudo apt-get update && apt-get install -y apt-utils && apt-get install -y unzip
mkdir ${{ runner.temp }}/protoc_install
wget https://github.com/protocolbuffers/protobuf/releases/download/v${{ env.COMMON_PROTOC_VERSION }}/protoc-${{ env.COMMON_PROTOC_VERSION }}-linux-x86_64.zip -P ${{ runner.temp }}/protoc_install
unzip ${{ runner.temp }}/protoc_install/*.zip -d ${{ runner.temp }}/protoc_install/protoc
echo "${{ runner.temp }}/protoc_install/protoc/bin" >> $GITHUB_PATH
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: ${{ env.GRADLE_VERSION }}
- name: Execute build
working-directory: ./java
run: ./gradlew jar
- name: Archive built jars
uses: actions/upload-artifact@v3
with:
name: target_jars
path: java/build/libs/*.jar
run-tests-java11:
runs-on: ubuntu-latest
needs: build-java
steps:
# Run `git checkout`
- uses: actions/checkout@v3
- name: Download t2iapi jar artifact
uses: actions/download-artifact@v3
with:
name: target_jars
path: java/build/libs/
- name: Detect release version
if: startsWith(github.ref, 'refs/tags/v')
run: |
echo RELEASE_VERSION=1 >> $GITHUB_ENV
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: ${{ env.GRADLE_VERSION }}
- name: Execute tests
working-directory: tests/java
run: ./gradlew test
- name: Archive test results
uses: actions/upload-artifact@v3
with:
name: test_results
path: tests/java/build/reports/tests/test/**/*.*
deploy-github-packages:
runs-on: ubuntu-latest
needs: run-tests-java11
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
permissions:
packages: write
contents: write
steps:
- uses: actions/checkout@v3
- name: Source dependency versions
working-directory: config
run: |
cat versions.txt >> $GITHUB_ENV
- name: Download t2iapi test results artifact
uses: actions/download-artifact@v3
with:
name: test_results
path: test_results/
- name: Detect release version
if: startsWith(github.ref, 'refs/tags/v')
run: |
echo RELEASE_VERSION=1 >> $GITHUB_ENV
- name: Install Protoc
run: |
sudo apt-get update && apt-get install -y apt-utils && apt-get install -y unzip
mkdir ${{ runner.temp }}/protoc_install
wget https://github.com/protocolbuffers/protobuf/releases/download/v${{ env.COMMON_PROTOC_VERSION }}/protoc-${{ env.COMMON_PROTOC_VERSION }}-linux-x86_64.zip -P ${{ runner.temp }}/protoc_install
unzip ${{ runner.temp }}/protoc_install/*.zip -d ${{ runner.temp }}/protoc_install/protoc
echo "${{ runner.temp }}/protoc_install/protoc/bin" >> $GITHUB_PATH
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: ${{ env.GRADLE_VERSION }}
- name: Publish package
working-directory: ./java
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install zip
if: startsWith(github.ref, 'refs/tags/')
uses: montudor/action-zip@v1
- name: Zip test results
if: startsWith(github.ref, 'refs/tags/')
run: |
zip -qq -r java-test-results.zip test_results
- name: Attach artifacts to github release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
java/build/libs/*.jar
java/build/publications/maven/pom-default.xml
java-test-results.zip
prerelease: ${{ !startsWith(github.ref, 'refs/tags/v') }}
body_path: CHANGELOG.md