diff --git a/.github/actions/build-dependencies/action.yml b/.github/actions/build-dependencies/action.yml new file mode 100644 index 000000000..a6961d32c --- /dev/null +++ b/.github/actions/build-dependencies/action.yml @@ -0,0 +1,29 @@ +name: Reusable build steps +description: Setups the build environment and builds Jameica and Hibiscus +runs: + using: "composite" + steps: + - name: Set up JDK for x64 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + architecture: x64 + + - name: Restore build dependencies + id: restore-cache + uses: actions/cache@v4 + with: + path: | + jameica/bin/ + jameica/lib/ + jameica/releases/jameica-lib.jar + hibiscus/bin/ + hibiscus/lib/ + hibiscus/releases/hibiscus-lib.jar + key: ${{ hashFiles('jverein/build/build.properties', 'jverein/build/build.xml') }} + + - name: Build Jameica and Hibiscus + if: steps.restore-cache.outputs.cache-hit != 'true' + shell: bash + run: ant -noinput -buildfile jverein/build/build.xml build-dependencies diff --git a/.github/workflows/buildcheck.yml b/.github/workflows/buildcheck.yml index 642ecc028..7406b620e 100644 --- a/.github/workflows/buildcheck.yml +++ b/.github/workflows/buildcheck.yml @@ -13,29 +13,19 @@ on: - 'lib.src/**' - 'src/**' - '.github/workflows/**/*.yml' + - '.github/actions/**/*.yml' + push: jobs: - call-reusable-workflow: - uses: ./.github/workflows/reusable-build.yml - build-check: - needs: call-reusable-workflow runs-on: ubuntu-latest steps: - - name: Restore cached tags and jars - id: cache-tags-jars - uses: actions/cache@v4 - with: - path: | - ./cached-tags - jameica - hibiscus - key: ${{ runner.os }}-${{ github.repository_id }} - - name: Checkout openjverein uses: actions/checkout@v4 with: path: jverein + - name: Setup + uses: ./jverein/.github/actions/build-dependencies + - name: Build openjverein plugin - working-directory: ./ run: ant -noinput -buildfile jverein/build/build.xml compile diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index 1156d7691..d8303ec38 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -11,31 +11,19 @@ on: - '**' jobs: - call-reusable-workflow: - uses: ./.github/workflows/reusable-build.yml - nightly-build: - needs: call-reusable-workflow runs-on: ubuntu-latest steps: - - name: Restore cached tags and jars - id: cache-tags-jars - uses: actions/cache@v4 - with: - path: | - ./cached-tags - jameica - hibiscus - key: ${{ runner.os }}-${{ github.repository_id }} - - name: Checkout openjverein uses: actions/checkout@v4 with: path: jverein + - name: Setup + uses: ./jverein/.github/actions/build-dependencies + - name: Build openjverein plugin id: openjverein - working-directory: ./ run: | ant_output=$(ant -e -q -noinput -buildfile jverein/build/build.xml nightly) echo ${ant_output} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a595da09e..5429f0c7e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,31 +6,19 @@ name: OpenJVerein official release on: workflow_dispatch jobs: - call-reusable-workflow: - uses: ./.github/workflows/reusable-build.yml - release: - needs: call-reusable-workflow runs-on: ubuntu-latest steps: - - name: Restore cached tags and jars - id: cache-tags-jars - uses: actions/cache@v4 - with: - path: | - ./cached-tags - jameica - hibiscus - key: ${{ runner.os }}-${{ github.repository_id }} - - name: Checkout openjverein uses: actions/checkout@v4 with: path: jverein + - name: Setup + uses: ./jverein/.github/actions/build-dependencies + - name: Build openjverein plugin id: openjverein - working-directory: ./ run: | ant_output=$(ant -e -q -noinput -buildfile jverein/build/build.xml) echo ${ant_output} diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml deleted file mode 100644 index 57695dae8..000000000 --- a/.github/workflows/reusable-build.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Reusable build steps - -on: - workflow_call: - -jobs: - setup-java-and-cache: - runs-on: ubuntu-latest - steps: - - name: Set up JDK for x64 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - architecture: x64 - - - name: Set env - id: setenvs - run: | - jameica_tag=$(git ls-remote --refs --tags --sort="-v:refname" https://github.com/willuhn/jameica.git V_\* | head -1 | cut -f 2 | cut -d / -f 3) - echo "jameica_tag=${jameica_tag}" >> $GITHUB_ENV - hibiscus_tag=$(git ls-remote --refs --tags --sort="-v:refname" https://github.com/willuhn/hibiscus.git V_\* | head -1 | cut -f 2 | cut -d / -f 3) - echo "hibiscus_tag=${hibiscus_tag}" >> $GITHUB_ENV - echo "### jameica_tag: ${jameica_tag} | hibiscus_tag: ${hibiscus_tag}" - - - name: Restore cached tags and folders - id: cache-tags-jars - uses: actions/cache@v4 - with: - path: | - ./cached-tags - jameica - hibiscus - key: ${{ runner.os }}-${{ github.repository_id }} - - - name: Load cached tags - id: load-cache - run: | - if [ -f ./cached-tags/jameica_tag ]; then - cached_jameica_tag=$(cat ./cached-tags/jameica_tag) - echo "cached_jameica_tag=${cached_jameica_tag}" >> $GITHUB_ENV - else - echo "cached_jameica_tag=" >> $GITHUB_ENV - fi - if [ -f ./cached-tags/hibiscus_tag ]; then - cached_hibiscus_tag=$(cat ./cached-tags/hibiscus_tag) - echo "cached_hibiscus_tag=${cached_hibiscus_tag}" >> $GITHUB_ENV - else - echo "cached_hibiscus_tag=" >> $GITHUB_ENV - fi - echo "### cached_jameica_tag: ${cached_jameica_tag} | cached_hibiscus_tag: ${cached_hibiscus_tag}" - - - name: Checkout jameica - if: ${{ env.cached_jameica_tag != env.jameica_tag }} - uses: actions/checkout@v4 - with: - repository: willuhn/jameica - path: jameica - ref: ${{ env.jameica_tag }} - - - name: Build jameica jar - if: ${{ env.cached_jameica_tag != env.jameica_tag }} - working-directory: ./ - run: | - ant -noinput -buildfile jameica/build/build.xml jar - find jameica/releases/ -type f -name jameica.jar -exec cp {} jameica/releases/jameica-lib.jar \; - - - name: Checkout hibiscus - if: ${{ env.cached_hibiscus_tag != env.hibiscus_tag }} - uses: actions/checkout@v4 - with: - repository: willuhn/hibiscus - path: hibiscus - ref: ${{ env.hibiscus_tag }} - - - name: Build hibiscus jar - if: ${{ env.cached_hibiscus_tag != env.hibiscus_tag }} - working-directory: ./ - run: | - ant -noinput -buildfile hibiscus/build/build.xml jar - find hibiscus/releases/ -type f -name hibiscus.jar -exec cp {} hibiscus/releases/hibiscus-lib.jar \; - - - name: Create cache files and needed folders - run: | - mkdir -p ./cached-tags - echo "${{ env.jameica_tag }}" > ./cached-tags/jameica_tag - echo "${{ env.hibiscus_tag }}" > ./cached-tags/hibiscus_tag - - - name: Cache tags and folders - uses: actions/cache@v4 - if: always() - with: - path: | - ./cached-tags - jameica - hibiscus - key: ${{ runner.os }}-${{ github.repository_id }} diff --git a/build/build.properties b/build/build.properties index 83a84d147..2d952c45d 100644 --- a/build/build.properties +++ b/build/build.properties @@ -18,3 +18,8 @@ project.javadoc = ${project.release}/javadoc project.zipdir = ${project.release}/${plugin.name} project.zipfilename = ${plugin.name}.${plugin.version}.zip project.zipfilename.nightly = ${plugin.name}.${plugin.version}-nightly.zip + +jameica.url = https://github.com/willuhn/jameica/archive/refs/tags +jameica.version = V_2_10_5_BUILD_488 +hibiscus.url = https://github.com/willuhn/hibiscus/archive/refs/tags +hibiscus.version = V_2_10_24_BUILD_388 diff --git a/build/build.xml b/build/build.xml index c5c8df499..de1c2e6e6 100644 --- a/build/build.xml +++ b/build/build.xml @@ -15,9 +15,9 @@ - - - + + + @@ -54,9 +54,10 @@ - - - + + + @@ -84,7 +85,7 @@ - + @@ -142,16 +143,16 @@ - + - - - + + + @@ -161,16 +162,50 @@ - - + + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +