Skip to content

Rebuild

Rebuild #1731

Workflow file for this run

name: Rebuild
on:
schedule:
- cron: 0 0 * * *
jobs:
rebuild:
name: Rebuild
runs-on: ubuntu-24.04
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
include:
- branch: '3.28'
python-version: '3.11'
- branch: '3.29'
python-version: '3.11'
- branch: '3.30'
python-version: '3.11'
steps:
- run: docker system prune --all --force
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Get tag
id: tag2
uses: frabert/[email protected]
with:
pattern: refs/tags/(.*)
string: '{{ github.ref }}'
replace-with: $1
if: startsWith(github.ref, 'refs/tags/')
- run: echo --${{ steps.tag2.outputs.replaced }}--
- uses: camptocamp/initialise-gopass-summon-action@v2
with:
ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}}
github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}}
patterns: docker
- run: gpg --export-secret-keys --armor D121AF2DFA8E140688BD968930C9B913FD42EF13 > CI.asc
- id: last-tag
run: echo "tag=$(git describe --tags --abbrev=0)" > $GITHUB_OUTPUT
- id: no-tag
run: echo "nb=$(git log --oneline ${{ steps.last-tag.outputs.tag }}..HEAD|wc -l)" > $GITHUB_OUTPUT
- run: sed --in-place 's/version = .*/version = "${{ steps.last-tag.outputs.tag }}"/g' build.gradle
if: steps.no-tag.outputs.nb == 0
- run:
sed --in-place 's/version = .*/version = "${{ steps.last-tag.outputs.tag }}+${{ steps.no-tag.outputs.nb
}}"/g' build.gradle
if: steps.no-tag.outputs.nb > 0
- run: echo "enablePublishing=true" > gradle.properties
- run: git diff
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: python3 -m pip install --requirement=ci/requirements.txt
- run: make build
# Extract artifacts
- run: docker run --rm --detach --name=builder mapfish_print_builder
if: always()
- run: docker cp builder:/src/core/build/ core/build/
if: always()
- uses: actions/upload-artifact@v4
with:
name: Test results
path: core/build/resources/actual
if: failure()
- uses: actions/upload-artifact@v4
with:
name: Reports core
path: core/build/reports
if: failure()
- name: Collect test results
run: |
mkdir -p /tmp/test_results/junit
find . -name '*TEST-*.xml' -exec cp -v {} /tmp/test_results/junit/ \;
if: failure()
- uses: actions/upload-artifact@v4
with:
name: Test results
path: /tmp/test_results
if: failure()
- name: Publish
run: c2cciutils-publish --type=rebuild --branch=${{ matrix.branch }}
- run: ./gradlew :core:libSourcesJar
if: startsWith(github.ref, 'refs/tags/')
- run: ./gradlew :core:libJavadocJar
if: startsWith(github.ref, 'refs/tags/')
- id: version
run: echo "version=$(grep 'version = ' build.gradle|sed "s/ \+version = .\(.*\)./\1/g")" > $GITHUB_OUTPUT
- id: tag
run: echo "tag=$(echo github.ref|sed 's%refs/tags/%%g')" > $GITHUB_OUTPUT
- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.tag.outputs.tag }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')
- name: Upload Release Asset
uses: actions/[email protected]
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./core/build/libs/print-servlet-${{ steps.version.outputs.version }}.war
asset_name: print-servlet-${{ steps.version.outputs.version }}.war
asset_content_type: application/java-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')
- name: Upload Release Asset
uses: actions/[email protected]
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./core/build/distributions/core-${{ steps.version.outputs.version }}.zip
asset_name: print-cli-${{ steps.version.outputs.version }}.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')
- name: Upload Release Asset
uses: actions/[email protected]
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./core/build/libs/print-lib-${{ steps.version.outputs.version }}.jar
asset_name: print-lib-${{ steps.version.outputs.version }}.jar
asset_content_type: application/java-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')
- name: Upload Release Asset
uses: actions/[email protected]
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./core/build/libs/print-lib-${{ steps.version.outputs.version }}-sources.jar
asset_name: print-lib-${{ steps.version.outputs.version }}-sources.jar
asset_content_type: application/java-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')
- name: Upload Release Asset
uses: actions/[email protected]
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./core/build/libs/print-lib-${{ steps.version.outputs.version }}-javadoc.jar
asset_name: print-lib-${{ steps.version.outputs.version }}-javadoc.jar
asset_content_type: application/java-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')