|
| 1 | +name: 'install-mvnd' |
| 2 | +description: 'Install the maven daemon' |
| 3 | +inputs: |
| 4 | + version: |
| 5 | + description: 'The version of the maven daemon to install' |
| 6 | + required: true |
| 7 | + default: '0.9.0' |
| 8 | +outputs: |
| 9 | + mvnd-dir: |
| 10 | + description: "The directory where the command mvnd is located" |
| 11 | + value: ${{ steps.mvnd-location.outputs.mvnd-dir }} |
| 12 | +runs: |
| 13 | + using: "composite" |
| 14 | + steps: |
| 15 | + - name: Download mvnd (Linux) |
| 16 | + if: runner.os == 'Linux' |
| 17 | + shell: bash |
| 18 | + run: | |
| 19 | + curl -fsSL -o mvnd.zip https://archive.apache.org/dist/maven/mvnd/${{ inputs.version }}/maven-mvnd-${{ inputs.version }}-linux-amd64.zip |
| 20 | + curl -fsSL -o mvnd.zip.sha256 https://archive.apache.org/dist/maven/mvnd/${{ inputs.version }}/maven-mvnd-${{ inputs.version }}-linux-amd64.zip.sha256 |
| 21 | + - name: Download mvnd (macOS) |
| 22 | + if: runner.os == 'macOS' |
| 23 | + shell: bash |
| 24 | + run: | |
| 25 | + curl -fsSL -o mvnd.zip https://archive.apache.org/dist/maven/mvnd/${{ inputs.version }}/maven-mvnd-${{ inputs.version }}-darwin-amd64.zip |
| 26 | + curl -fsSL -o mvnd.zip.sha256 https://archive.apache.org/dist/maven/mvnd/${{ inputs.version }}/maven-mvnd-${{ inputs.version }}-darwin-amd64.zip.sha256 |
| 27 | + - name: Download mvnd (Windows) |
| 28 | + if: runner.os == 'Windows' |
| 29 | + shell: bash |
| 30 | + run: | |
| 31 | + curl -fsSL -o mvnd.zip https://archive.apache.org/dist/maven/mvnd/${{ inputs.version }}/maven-mvnd-${{ inputs.version }}-windows-amd64.zip |
| 32 | + curl -fsSL -o mvnd.zip.sha256 https://archive.apache.org/dist/maven/mvnd/${{ inputs.version }}/maven-mvnd-${{ inputs.version }}-windows-amd64.zip.sha256 |
| 33 | + - name: Install sha256sum (macOS) |
| 34 | + if: runner.os == 'macOS' |
| 35 | + shell: bash |
| 36 | + run: brew install coreutils |
| 37 | + - name: Verify sha256sum |
| 38 | + shell: bash |
| 39 | + run: echo "$(cat mvnd.zip.sha256) mvnd.zip" | sha256sum --check |
| 40 | + - name: Unzip mvnd |
| 41 | + shell: bash |
| 42 | + run: unzip mvnd.zip -d /tmp/ |
| 43 | + - id: mvnd-location |
| 44 | + shell: bash |
| 45 | + run: | |
| 46 | + MVND_BIN_DIR="$(find /tmp/ -maxdepth 1 -name 'maven-mvnd-${{ inputs.version }}-*-amd64' -type d)/bin" |
| 47 | + if [ "$RUNNER_OS" == "Windows" ]; then |
| 48 | + MVND_BIN_DIR="$(cygpath --absolute --long-name --windows $MVND_BIN_DIR)" |
| 49 | + fi |
| 50 | + echo "mvnd-dir=${MVND_BIN_DIR}" >> $GITHUB_OUTPUT |
0 commit comments