Skip to content

Commit

Permalink
feature: Use static binary instead of docker image (#75)
Browse files Browse the repository at this point in the history
* feature: Use static binary instead of docker image

* Install in /usr/local/bin

* Remove --folder /repo

* Use tool-version when provided

* Quote strings in bash
  • Loading branch information
lolgab authored Nov 22, 2022
1 parent f68a42d commit 80c816f
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,23 @@ outputs:
runs:
using: "composite"
steps:
- shell: bash
run: |
set -eo pipefail
if [ "${{ inputs.tool-version }}" = "latest" ]; then
download_url="$(curl -Ls https://api.github.com/repos/codacy/git-version/releases/latest | jq -r .assets[0].browser_download_url)"
else
download_url="https://github.com/codacy/git-version/releases/download/${{ inputs.tool-version }}/git-version"
fi
curl -Ls "$download_url" > /usr/local/bin/git-version
chmod +x /usr/local/bin/git-version
- id: previous-version
shell: bash
run: |
set -eo pipefail
export PREVIOUS_VERSION=$(docker run -v $(pwd):/repo codacy/git-version:${{ inputs.tool-version }} \
/bin/git-version \
export PREVIOUS_VERSION=$(git-version \
--previous-version \
--folder /repo \
--release-branch "${{ inputs.release-branch }}" \
--dev-branch "${{ inputs.dev-branch }}" \
--minor-identifier="${{ inputs.minor-identifier }}" \
Expand All @@ -64,9 +72,7 @@ runs:
run: |
set -eo pipefail
export VERSION=$(docker run -v $(pwd):/repo codacy/git-version:${{ inputs.tool-version }} \
/bin/git-version \
--folder /repo \
export VERSION=$(git-version \
--release-branch "${{ inputs.release-branch }}" \
--dev-branch "${{ inputs.dev-branch }}" \
--minor-identifier="${{ inputs.minor-identifier }}" \
Expand Down

0 comments on commit 80c816f

Please sign in to comment.