Skip to content

Commit

Permalink
Remove deprecated output production syntax (#8)
Browse files Browse the repository at this point in the history
Remove deprecated output production syntax
  • Loading branch information
lhstrh authored Aug 25, 2023
1 parent 82c2197 commit 23839f3
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ runs:
id: find
working-directory: ${{ inputs.path }}
run: |
echo "::set-output name=tag::$(greatest-semver-tag)"
echo "tag=$(greatest-semver-tag)" >> "$GITHUB_OUTPUT"
shell: bash
- name: Set current version based on stripped tag
id: cur
Expand All @@ -107,64 +107,64 @@ runs:
echo "Invalid override."; exit 1
fi
fi
echo "::set-output name=ver::${{ inputs.override }}"
echo "ver=${{ inputs.override }}" >> "$GITHUB_OUTPUT"
elif [[ "${{ steps.find.outputs.tag }}" = "" ]]; then
echo "::set-output name=ver::0.0.0"
echo "ver=0.0.0" >> "$GITHUB_OUTPUT"
else
echo "::set-output name=ver::$(echo "${{ steps.find.outputs.tag }}" | sed 's/^[^0-9]*//')"
echo "ver=$(echo "${{ steps.find.outputs.tag }}" | sed 's/^[^0-9]*//')" >> "$GITHUB_OUTPUT"
fi
shell: bash
- name: Determine the prefix and set it
id: prefix
run: >
ver="${{ steps.cur.outputs.ver }}";
if [[ "${{ inputs.override }}" != "" ]]; then
echo "::set-output name=str::$(echo ${${{ inputs.override }}%"$ver"})"
echo "str=$(echo ${${{ inputs.override }}%"$ver"})" >> "$GITHUB_OUTPUT"
elif [[ "${{ steps.find.outputs.tag }}" != "" ]]; then
echo "::set-output name=str::$(echo ${${{ steps.find.outputs.tag }}%"$ver"})"
echo "str=$(echo ${${{ steps.find.outputs.tag }}%"$ver"})" >> "$GITHUB_OUTPUT"
fi
shell: bash
- name: Test if planned input is greater than current
id: test
run: >
if [[ $(semver compare ${{ inputs.planned }} ${{ steps.cur.outputs.ver }}) -eq 1 ]]; then
echo "::set-output name=greater::true"
echo "greater=true" >> "$GITHUB_OUTPUT"
else
echo "::set-output name=greater::false"
echo "greater=false" >> "$GITHUB_OUTPUT"
fi
shell: bash
if: ${{ inputs.planned != '' }}
- name: Produce increments
id: incr
run: |
echo "::set-output name=patch::$(semver bump patch ${{ steps.cur.outputs.ver }})"
echo "::set-output name=minor::$(semver bump minor ${{ steps.cur.outputs.ver }})"
echo "::set-output name=major::$(semver bump major ${{ steps.cur.outputs.ver }})"
echo "::set-output name=prerelease::$(semver bump prerel ${{ inputs.prerelease }} ${{ steps.cur.outputs.ver }})"
echo "::set-output name=release::$(semver bump release ${{ steps.cur.outputs.ver }})"
echo "patch=$(semver bump patch ${{ steps.cur.outputs.ver }})" >> "$GITHUB_OUTPUT"
echo "minor=$(semver bump minor ${{ steps.cur.outputs.ver }})" >> "$GITHUB_OUTPUT"
echo "major=$(semver bump major ${{ steps.cur.outputs.ver }})" >> "$GITHUB_OUTPUT"
echo "prerelease=$(semver bump prerel ${{ inputs.prerelease }} ${{ steps.cur.outputs.ver }})" >> "$GITHUB_OUTPUT"
echo "release=$(semver bump release ${{ steps.cur.outputs.ver }})" >> "$GITHUB_OUTPUT"
shell: bash
- name: Produce build increment if a build string was given
id: build
run: |
echo "::set-output name=incr::$(semver bump build ${{ inputs.build }} ${{ steps.cur.outputs.ver }})"
echo "incr=$(semver bump build ${{ inputs.build }} ${{ steps.cur.outputs.ver }})" >> "$GITHUB_OUTPUT"
shell: bash
if: ${{ inputs.build != '' }}
- name: Produce version bump (if requested)
id: bump
run: >
if [[ "${{ inputs.bump }}" = "patch" ]]; then
echo "::set-output name=ver::${{ steps.incr.outputs.patch }}"
echo "ver=${{ steps.incr.outputs.patch }}" >> "$GITHUB_OUTPUT"
elif [[ "${{ inputs.bump }}" = "minor" ]]; then
echo "::set-output name=ver::${{ steps.incr.outputs.minor }}"
echo "ver=${{ steps.incr.outputs.minor }}" >> "$GITHUB_OUTPUT"
elif [[ "${{ inputs.bump }}" = "major" ]]; then
echo "::set-output name=ver::${{ steps.incr.outputs.major }}"
echo "ver=${{ steps.incr.outputs.major }}" >> "$GITHUB_OUTPUT"
elif [[ "${{ inputs.bump }}" = "release" ]]; then
echo "::set-output name=ver::${{ steps.incr.outputs.release }}"
echo "ver=${{ steps.incr.outputs.release }}" >> "$GITHUB_OUTPUT"
elif [[ "${{ inputs.bump }}" = "prerelease" ]]; then
echo "::set-output name=ver::${{ steps.incr.outputs.prerelease }}"
echo "ver=${{ steps.incr.outputs.prerelease }}" >> "$GITHUB_OUTPUT"
elif [[ "${{ inputs.bump }}" = "build" ]]; then
if [[ "${{ inputs.build }}" != "" ]]; then
echo "::set-output name=ver::${{ steps.incr.outputs.next-build }}"
echo "ver=${{ steps.incr.outputs.next-build }}" >> "$GITHUB_OUTPUT"
else
echo "The build input must be set when requesting build bump";
fi
Expand Down

0 comments on commit 23839f3

Please sign in to comment.