Version 5.8.0.1 #23
Workflow file for this run
This file contains hidden or 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: Build clingo and publish JAR | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| build_only: | |
| description: 'Whether to only build the project and skip releasing it (yes/NO)' | |
| required: false | |
| default: 'no' | |
| release: | |
| types: [ created ] | |
| env: | |
| CLINGO_RELEASE: "v5.8.0" | |
| jobs: | |
| build-linux-native: | |
| name: Build ${{ matrix.target.name }} | |
| runs-on: ${{ matrix.target.runs_on }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - { name: linux-x86-64, runs_on: ubuntu-24.04 } | |
| - { name: linux-aarch64, runs_on: ubuntu-24.04-arm } | |
| steps: | |
| - name: Checkout clingo | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: potassco/clingo | |
| submodules: recursive | |
| path: clingo | |
| ref: ${{ env.CLINGO_RELEASE }} | |
| - name: Checkout jclingo | |
| uses: actions/checkout@v5 | |
| with: | |
| path: jclingo | |
| - name: Build clingo | |
| run: | | |
| cd ${{ github.workspace }}/clingo | |
| ../jclingo/.github/build.sh | |
| - name: Move library | |
| run: | | |
| cd ${{ github.workspace }} | |
| mkdir -p jclingo/src/main/resources/${{ matrix.target.name }} | |
| cp -p clingo/build/bin/libclingo.so jclingo/src/main/resources/${{ matrix.target.name }}/libclingo.so | |
| - name: Upload clingo | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: libraries-${{ matrix.target.name }} | |
| path: ${{ github.workspace }}/jclingo/src/main/resources/ | |
| build-macos-native: | |
| name: Build ${{ matrix.target.name }} | |
| runs-on: macos-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - { name: darwin-x86-64, cmake: '-DCMAKE_OSX_ARCHITECTURES=x86_64' } | |
| - { name: darwin-aarch64, cmake: '-DCMAKE_OSX_ARCHITECTURES=arm64' } | |
| steps: | |
| - name: Checkout clingo | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: potassco/clingo | |
| submodules: recursive | |
| path: clingo | |
| ref: ${{ env.CLINGO_RELEASE }} | |
| - name: Checkout jclingo | |
| uses: actions/checkout@v5 | |
| with: | |
| path: jclingo | |
| - name: Build clingo | |
| run: | | |
| cd ${{ github.workspace }}/clingo | |
| ../jclingo/.github/build.sh ${{ matrix.target.cmake }} | |
| - name: Move library | |
| run: | | |
| cd ${{ github.workspace }} | |
| mkdir -p jclingo/src/main/resources/${{ matrix.target.name }} | |
| cp -p clingo/build/bin/libclingo.dylib jclingo/src/main/resources/${{ matrix.target.name }}/libclingo.dylib | |
| - name: Upload clingo | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: libraries-${{ matrix.target.name }} | |
| path: ${{ github.workspace }}/jclingo/src/main/resources/ | |
| build-win-native: | |
| name: Build ${{ matrix.target.name }} | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - { name: win32-x86-64, cmake: '-G "Visual Studio 17 2022" -A "x64"' } | |
| - { name: win32-aarch64, cmake: '-G "Visual Studio 17 2022" -A "ARM64"' } | |
| steps: | |
| - name: Checkout clingo | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: potassco/clingo | |
| submodules: recursive | |
| path: clingo | |
| ref: ${{ env.CLINGO_RELEASE }} | |
| - name: Checkout jclingo | |
| uses: actions/checkout@v5 | |
| with: | |
| path: jclingo | |
| - name: Build clingo | |
| shell: cmd | |
| run: | | |
| cd ${{ github.workspace }}\clingo | |
| ..\jclingo\.github\build.bat ${{ matrix.target.cmake }} | |
| - name: Move library | |
| shell: cmd | |
| run: | | |
| cd ${{ github.workspace }} | |
| mkdir jclingo\src\main\resources\${{ matrix.target.name }} | |
| move clingo\build\bin\Release\clingo.dll jclingo\src\main\resources\${{ matrix.target.name }} | |
| - name: Upload clingo | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: libraries-${{ matrix.target.name }} | |
| path: ${{ github.workspace }}\jclingo\src\main\resources\ | |
| test-linux: | |
| name: Test ${{ matrix.target.name }} | |
| runs-on: ${{ matrix.target.runs_on }} | |
| needs: build-linux-native | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - { name: linux-x86-64, runs_on: ubuntu-24.04 } | |
| - { name: linux-aarch64, runs_on: ubuntu-24.04-arm } | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: libraries-${{ matrix.target.name }} | |
| path: ${{ github.workspace }}/src/main/resources/ | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '11' | |
| - name: Run tests | |
| shell: bash | |
| run: mvn test | |
| test-macos: | |
| name: Test MacOS | |
| needs: build-macos-native | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: libraries-darwin-x86-64 | |
| path: ${{ github.workspace }}/src/main/resources/ | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '11' | |
| - name: Run tests | |
| shell: bash | |
| run: mvn test | |
| test-windows: | |
| name: Test Windows | |
| needs: build-win-native | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: libraries-win32-x86-64 | |
| path: ${{ github.workspace }}\src\main\resources\ | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '11' | |
| - name: Run tests | |
| shell: cmd | |
| run: mvn test | |
| release-github-packages: | |
| name: Publish to GitHub packages | |
| if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.build_only == 'no' }} | |
| needs: [ test-linux, test-macos, test-windows ] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: libraries* | |
| merge-multiple: true | |
| path: ${{ github.workspace }}/src/main/resources/ | |
| - uses: actions/setup-java@v4 | |
| with: | |
| java-version: '11' | |
| distribution: 'zulu' | |
| - name: Publish package | |
| run: mvn --batch-mode -P github deploy | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| release-maven-central: | |
| name: Publish to Maven Central | |
| if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.build_only == 'no' }} | |
| needs: [ test-linux, test-macos, test-windows ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: libraries* | |
| merge-multiple: true | |
| path: ${{ github.workspace }}/src/main/resources/ | |
| - name: Set up Maven Central Repository | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '11' | |
| distribution: 'zulu' | |
| server-id: ossrh | |
| server-username: MAVEN_USERNAME | |
| server-password: MAVEN_PASSWORD | |
| gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }} | |
| gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
| - name: Publish package | |
| run: mvn --batch-mode -P ossrh deploy | |
| env: | |
| MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
| MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} |