Bump Selmer #2
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 | |
| on: | |
| push: | |
| paths-ignore: | |
| - "**.md" | |
| - "logo/**" | |
| branches: | |
| - master | |
| pull_request: | |
| paths-ignore: | |
| - "**.md" | |
| - "logo/**" | |
| branches: | |
| - master | |
| # TODO: Add deploy if needed | |
| jobs: | |
| jvm: | |
| if: ${{ false }} # Disabled | |
| # if: "!contains(github.event.head_commit.message, 'skip ci')" | |
| runs-on: ubuntu-latest | |
| env: | |
| LEIN_ROOT: "true" | |
| BABASHKA_PLATFORM: linux # could be used in jar name | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| BABASHKA_SHA: ${{ github.sha }} | |
| steps: | |
| - name: Git checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 1 | |
| submodules: 'true' | |
| - name: Cache deps | |
| uses: actions/cache@v4 | |
| id: cache-deps | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('project.clj') }} | |
| restore-keys: ${{ runner.os }}-maven- | |
| - name: Prepare java | |
| uses: actions/setup-java@v2 | |
| with: | |
| distribution: 'adopt-hotspot' | |
| java-version: '19' | |
| - name: Install clojure tools | |
| uses: DeLaGuardo/setup-clojure@13.4 | |
| with: | |
| cli: latest | |
| lein: 2.9.8 | |
| - name: Run tests | |
| env: | |
| BABASHKA_FEATURE_JDBC: "true" | |
| BABASHKA_FEATURE_POSTGRESQL: "true" | |
| run: | | |
| script/test | |
| script/run_lib_tests | |
| - name: Build uberjar | |
| run: | | |
| mkdir -p /tmp/release | |
| script/uberjar | |
| VERSION=$(cat resources/BABASHKA_VERSION) | |
| jar=target/babashka-$VERSION-standalone.jar | |
| cp $jar /tmp/release | |
| java -jar $jar script/reflection.clj | |
| reflection="babashka-$VERSION-reflection.json" | |
| java -jar "$jar" --config .build/bb.edn --deps-root . release-artifact "$jar" | |
| java -jar "$jar" --config .build/bb.edn --deps-root . release-artifact "$reflection" | |
| - name: Babashka version | |
| id: babashka-version | |
| run: | | |
| BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION) | |
| echo "##[set-output name=version;]${BABASHKA_VERSION}" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: babashka-${{ steps.babashka-version.outputs.version }}-standalone.jar | |
| path: target/babashka-${{ steps.babashka-version.outputs.version }}-standalone.jar | |
| native: | |
| if: "!contains(github.event.head_commit.message, 'skip ci')" | |
| strategy: | |
| matrix: | |
| include: | |
| - os: macos-15-intel | |
| name: macos | |
| arch: amd64 | |
| static: false | |
| oldest_macos_version: "11.0" | |
| - os: macos-14 | |
| name: macos | |
| static: false | |
| arch: aarch64 | |
| oldest_macos_version: "11.0" | |
| #- os: ubuntu-latest | |
| # name: linux | |
| # static: false | |
| #- os: ubuntu-latest | |
| # name: linux | |
| # static: true | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| LEIN_ROOT: "true" | |
| GRAALVM_VERSION: "25" | |
| BABASHKA_PLATFORM: ${{ matrix.name }} # used in release script | |
| BABASHKA_ARCH: ${{ matrix.arch }} | |
| BABASHKA_TEST_ENV: native | |
| BABASHKA_XMX: "-J-Xmx6500m" | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| BABASHKA_SHA: ${{ github.sha }} | |
| MACOSX_DEPLOYMENT_TARGET: ${{ matrix.oldest_macos_version }} | |
| steps: | |
| - name: Git checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 1 | |
| submodules: 'true' | |
| - name: Cache deps | |
| uses: actions/cache@v4 | |
| id: cache-deps | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('project.clj') }} | |
| restore-keys: ${{ runner.os }}-maven- | |
| - name: Setup GraalVM | |
| if: "matrix.static == false" | |
| uses: graalvm/setup-graalvm@v1.3.4 | |
| with: | |
| java-version: '25' | |
| distribution: 'graalvm' | |
| components: 'native-image' | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup GraalVM+musl | |
| if: "matrix.static == true" | |
| uses: graalvm/setup-graalvm@v1.3.4 | |
| with: | |
| java-version: '25' | |
| distribution: 'graalvm' | |
| native-image-musl: true | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install clojure tools | |
| uses: DeLaGuardo/setup-clojure@5.0 | |
| with: | |
| cli: 1.10.3.1040 | |
| lein: 2.9.8 | |
| - name: Install native dev tools | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get -y install build-essential zlib1g-dev | |
| - name: Babashka version | |
| id: babashka-version | |
| run: | | |
| BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION) | |
| echo "##[set-output name=version;]${BABASHKA_VERSION}" | |
| - name: Build uberjar | |
| run: script/uberjar | |
| - name: Build native image | |
| if: "matrix.static == false" | |
| run: script/compile | |
| - name: Build static native image | |
| if: "matrix.static == true" | |
| env: | |
| BABASHKA_STATIC: "true" | |
| BABASHKA_MUSL: "true" | |
| run: script/compile | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: bb | |
| name: babashka-${{ steps.babashka-version.outputs.version }}-${{ matrix.name }}-${{ matrix.arch }} | |
| - name: Upload static artifact | |
| if: "matrix.static == true" | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: bb | |
| name: babashka-${{ steps.babashka-version.outputs.version }}-${{ matrix.name }}-static-amd64 | |
| - name: Test binary and libs | |
| run: | | |
| script/test | |
| script/run_lib_tests | |
| - name: Release | |
| env: | |
| BABASHKA_RELEASE: true | |
| run: | | |
| .circleci/script/release | |
| docker: | |
| if: ${{ false }} # Disabled | |
| # if: "!contains(github.event.head_commit.message, 'skip ci') && github.event_name == 'push' && github.ref == 'refs/heads/master'" | |
| needs: | |
| - native | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Git checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 1 | |
| submodules: 'true' | |
| - name: Babashka version | |
| id: babashka-version | |
| run: | | |
| BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION) | |
| echo "##[set-output name=version;]${BABASHKA_VERSION}" | |
| - name: Make release dir | |
| run: mkdir -p /tmp/release | |
| - name: Download linux binary | |
| uses: actions/download-artifact@v4.1.7 | |
| with: | |
| name: babashka-${{ steps.babashka-version.outputs.version }}-linux-amd64.zip | |
| path: /tmp/release | |
| - name: Download static linux binary | |
| uses: actions/download-artifact@v4.1.7 | |
| with: | |
| name: babashka-${{ steps.babashka-version.outputs.version }}-linux-static-amd64.zip | |
| path: /tmp/release-static | |
| - name: Set up Docker Buildx | |
| id: buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Build uberjar | |
| run: script/uberjar | |
| - name: Docker build | |
| env: | |
| DOCKERHUB_USER: "${{ secrets.DOCKERHUB_USER }}" | |
| DOCKERHUB_PASS: "${{ secrets.DOCKERHUB_PASS }}" | |
| PLATFORMS: linux/amd64,linux/arm64 | |
| run: java -jar ./target/babashka-$(cat resources/BABASHKA_VERSION)-standalone.jar .circleci/script/docker.clj |