Skip to content

Commit

Permalink
run hyperd download as job
Browse files Browse the repository at this point in the history
  • Loading branch information
jschneidereit committed Feb 5, 2025
1 parent a282023 commit a71aa81
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 30 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ on:
pull_request:
branches: [ "main" ]

env:
HYPER_VERSION: "0.0.21200.re11c8cb9"

jobs:
download-hyperd:
uses: ./.github/workflows/hyperd.yml
with:
hyper_version: "0.0.21200.re11c8cb9"

build:
runs-on: ubuntu-latest
strategy:
Expand All @@ -22,20 +30,14 @@ jobs:
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: maven
- name: Call Hyper Download workflow
uses: ./.github/workflows/hyperd.yml
with:
target_directory: ${{ env.CURRENT_DIR }}
- name: Cache hyperd
uses: actions/cache@v3
# cache: maven
- name: Maven clean
run: mvn --batch-mode clean
- name: Restore hyperd from cache
uses: actions/cache@v4
with:
path: |
target/.cache
key: ${{ runner.os }}-hyper-${{ env.HYPER_VERSION }}
restore-keys: |
${{ runner.os }}-hyper-${{ env.HYPER_VERSION }}
path: target/hyper
fail-on-cache-miss: 'true'
key: hyperd-${{ runner.os }}-${{ env.HYPER_VERSION }}
- name: Maven package
run: |
mvn -v
mvn --batch-mode --no-transfer-progress clean package --file pom.xml -Dskip.hyper.download=true
run: mvn --batch-mode --no-transfer-progress package --file pom.xml -Dskip.hyper.download=true -X
21 changes: 9 additions & 12 deletions .github/workflows/hyperd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,16 @@ on:
hyper_version:
required: true
type: string
default: "0.0.21200.re11c8cb9"
target_directory:
required: true
type: string

jobs:
download-hyperd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache hyperd
id: cache-hyperd
uses: actions/cache@v4
with:
path: /tmp/hyperd
path: target/hyper
key: hyperd-${{ runner.os }}-${{ inputs.hyper_version }}
restore-keys:
hyperd-${{ runner.os }}-
Expand All @@ -31,11 +26,13 @@ jobs:
- name: Extract hyperd to target/hyper
if: steps.cache-hyperd.outputs.cache-hit != 'true'
run: |
mkdir -p /tmp/hyperd
unzip -j /tmp/hyperd.zip -d /tmp/hyperd "**/hyperd" "**/*.so"
mkdir -p target/hyper
unzip -j /tmp/hyperd.zip -d target/hyper "**/hyperd" "**/*.so"
- name: Move hyperd for maven
- name: Verify hyperd exists
run: |
mkdir -p ${{ inputs.target_directory }}/target/hyper
cp /tmp/hyperd/* ${{ inputs.target_directory }}/target/hyper/
chmod 700 ${{ inputs.target_directory }}/target/hyper/hyperd
ls -latrR
if [[ ! -f "target/hyper/hyperd" ]]; then
echo "ERROR: hyperd is missing!"
exit 1
fi
16 changes: 13 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ on:
release:
types: [ "created" ]

env:
HYPER_VERSION: "0.0.21200.re11c8cb9"

jobs:
download-hyperd:
uses: ./.github/workflows/hyperd.yml
with:
hyper_version: ${{ env.HYPER_VERSION }}

build:
runs-on: ubuntu-latest

Expand All @@ -20,10 +28,12 @@ jobs:
server-password: 'MAVEN_PASSWORD'
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: 'MAVEN_GPG_PASSPHRASE'
- name: Call Hyper Download workflow
uses: ./.github/workflows/hyperd.yml
- name: Restore hyperd from cache
uses: actions/cache@v4
with:
target_directory: ${{ env.CURRENT_DIR }}
path: target/hyper
fail-on-cache-miss: 'true'
key: hyperd-${{ runner.os }}-${{ env.HYPER_VERSION }}
- name: Set version
run: mvn versions:set --no-transfer-progress -DnewVersion=${{ github.event.release.tag_name }}
- name: Build with Maven
Expand Down

0 comments on commit a71aa81

Please sign in to comment.