Install newer version of gradle #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Workflow on Branch | |
on: | |
push: | |
branches: | |
- test-build | |
jobs: | |
test-build-on-branch: | |
runs-on: ubuntu-latest | |
container: | |
image: debian:bookworm | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Install Dependencies | |
run: | | |
apt-get -y update | |
apt-get -y install wget unzip openjdk-17-jdk-headless | |
- name: Download and Install Latest Gradle | |
run: | | |
LATEST_GRADLE_URL=$(curl -s https://gradle.org/releases/ | grep -oP '(?<=href=")[^"]*bin.zip' | head -1) | |
wget $LATEST_GRADLE_URL -O gradle-latest-bin.zip | |
unzip gradle-latest-bin.zip -d /opt/gradle | |
GRADLE_DIR=$(ls /opt/gradle) | |
ln -s /opt/gradle/$GRADLE_DIR/bin/gradle /usr/bin/gradle | |
- name: Set JAVA_HOME | |
run: | | |
export JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64" | |
export PATH="$JAVA_HOME/bin:$PATH" | |
- name: Verify Java Installation | |
run: | | |
java -version | |
- name: Build Package | |
run: | | |
./gradlew :distribution:packages:oss-no-jdk-deb:assemble \ | |
-Dbuild.docker=false \ | |
-Dbuild.snapshot=false \ | |
-Dlicense.key=/dev/null | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: deb-packages | |
path: distribution/packages/deb/build/distributions | |
retention-days: 1 |