diff --git a/.github/workflows/build_and_release.yml b/.github/workflows/build_and_release.yml index bdc9020..f5e49ba 100644 --- a/.github/workflows/build_and_release.yml +++ b/.github/workflows/build_and_release.yml @@ -17,7 +17,7 @@ on: # Else, maybe time to go back to the snap plugin we have. env: - SNAP_REPO: 'RocketChat/rocketchat-server-snap' + SNAP_REPO: 'RocketChat/server-snap' jobs: prepare: @@ -58,15 +58,7 @@ jobs: current_version="$(yq -e .version snap/snapcraft.yaml)" # no release candidate - is_lt() { - local v1=(${1//./ }) - local v2=(${2//./ }) - (( ${v1[0]} < ${v2[0]} )) && return 0 - (( ${v1[1]} < ${v2[1]} )) && return 0 - (( ${v1[2]} < ${v2[2]} )) && return 0 - return 1 - } - if ! is_lt $version $current_version; then + if semis gt $version $current_version; then run=true if [[ $candidate == 'false' ]]; then commit=true; fi fi diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e37340d..fb26fc8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,6 +48,8 @@ jobs: with: repository: ${{ env.REPO }} + - uses: debdutdeb/semis@main + - name: 'Prepare for next steps' id: prepare shell: bash @@ -75,21 +77,11 @@ jobs: current_version="$(yq -e .version snap/snapcraft.yaml)" # no release candidate - is_gt() { - local v1=(${1//./ }) - local v2=(${2//./ }) - (( ${v1[0]} > ${v2[0]} )) && return 0 - (( ${v1[1]} > ${v2[1]} )) && return 0 - (( ${v1[2]} > ${v2[2]} )) && return 0 - return 1 - } if [[ ${{ inputs.test-only }} == "true" ]]; then run=true - elif is_gt $version $current_version; then + elif semis gt $version $current_version || semis eq $version $current_version; then run=true if [[ $candidate == 'false' ]]; then commit=true; fi - elif [[ "$version" == "$current_version" ]]; then - run=true fi echo "run: $run" echo "commit: $commit"