fixup #455
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
| # SPDX-FileCopyrightText: 2024 Jomco B.V. | |
| # SPDX-FileCopyrightText: 2024 Stichting Connekt | |
| # SPDX-FileContributor: Joost Diepenmaat <joost@jomco.nl> | |
| # SPDX-FileContributor: Remco van 't Veer <remco@jomco.nl> | |
| # | |
| # SPDX-License-Identifier: AGPL-3.0-or-later | |
| name: Build artifacts | |
| on: | |
| push | |
| jobs: | |
| create_release: | |
| if: startsWith(github.ref, 'refs/tags/v0') || startsWith(github.ref, 'refs/tags/v1') | |
| runs-on: ubuntu-22.04 | |
| outputs: | |
| version: ${{ steps.version.outputs.version }} | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| permissions: | |
| # needed to create releases | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/cache@v5 | |
| with: | |
| path: "~/.m2" | |
| key: "prep-deps-${{ hashFiles('deps.edn') }}" | |
| restore-keys: "prep-deps-" | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Install clj runtime | |
| run: | | |
| cd "$HOME" | |
| curl -L -O https://github.com/clojure/brew-install/releases/latest/download/posix-install.sh | |
| chmod +x posix-install.sh | |
| sudo ./posix-install.sh | |
| - name: Prep deps | |
| run: clojure -P | |
| - name: version | |
| # need some shenanigans to get simple tag name from repo/tags/tagname ref | |
| run: echo "version=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT | |
| id: version | |
| - name: release | |
| uses: actions/create-release@v1 | |
| id: create_release | |
| with: | |
| draft: false | |
| prerelease: false | |
| release_name: ${{ steps.version.outputs.version }} | |
| tag_name: ${{ github.ref }} | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| build_services: | |
| needs: create_release | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| # needed to create releases | |
| contents: write | |
| strategy: | |
| matrix: | |
| service: [association-register, authorization-register, authentication-service, connector] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/cache@v5 | |
| with: | |
| path: "~/.m2" | |
| key: "prep-deps${{ hashFiles('deps.edn') }}" | |
| restore-keys: "prep-deps" | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Install clj runtime | |
| run: | | |
| cd "$HOME" | |
| curl -L -O https://github.com/clojure/brew-install/releases/latest/download/posix-install.sh | |
| chmod +x posix-install.sh | |
| sudo ./posix-install.sh | |
| - name: Build ${{ matrix.service }} zip | |
| run: make bdi-${{ matrix.service }}-${{ needs.create_release.outputs.version }}.zip | |
| - name: Upload ${{ matrix.service }}.zip | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| upload_url: ${{ needs.create_release.outputs.upload_url }} | |
| asset_path: bdi-${{ matrix.service }}-${{ needs.create_release.outputs.version }}.zip | |
| asset_name: bdi-${{ matrix.service }}-${{ needs.create_release.outputs.version }}.zip | |
| asset_content_type: application/octet-stream | |
| # publish to docker hub | |
| - name: Docker Login | |
| uses: azure/docker-login@v2 | |
| with: | |
| login-server: ${{ vars.ACR_HOSTNAME }} | |
| username: ${{ vars.ACR_USERNAME }} | |
| password: ${{ secrets.ACR_PASSWORD }} | |
| - name: Build and Push ${{ matrix.service }} to ACR | |
| uses: docker/build-push-action@v7 | |
| with: | |
| push: true | |
| file: "${{ matrix.service }}.dockerfile" | |
| tags: | | |
| ${{ vars.ACR_HOSTNAME }}/${{ matrix.service }}:${{ needs.create_release.outputs.version }} | |
| ${{ vars.ACR_HOSTNAME }}/${{ matrix.service }}:latest | |
| build_libs: | |
| needs: create_release | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| # needed to create releases | |
| contents: write | |
| strategy: | |
| max-parallel: 1 # order of release is important because of dependencies on published previous lib | |
| matrix: | |
| lib: [clj-ishare-jwt, clj-ishare-client, clj-authentication, clj-ring-middleware] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/cache@v5 | |
| with: | |
| path: "~/.m2" | |
| key: "prep-deps${{ hashFiles('deps.edn') }}" | |
| restore-keys: "prep-deps" | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Install clj runtime | |
| run: | | |
| cd "$HOME" | |
| curl -L -O https://github.com/clojure/brew-install/releases/latest/download/posix-install.sh | |
| chmod +x posix-install.sh | |
| sudo ./posix-install.sh | |
| # publish libs to clojars | |
| - name: Build and ${{ matrix.lib }} to clojars | |
| env: | |
| CLOJARS_USERNAME: ${{ vars.CLOJARS_USERNAME }} | |
| CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }} | |
| run: clojure -T:build jar :lib org.bdinetwork/${{ matrix.lib }} :version ${{ needs.create_release.outputs.version}} :deploy? true |