Skip to content

Commit

Permalink
use semis
Browse files Browse the repository at this point in the history
  • Loading branch information
debdutdeb committed Dec 6, 2024
1 parent b1bcf43 commit 5357b91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:
with:
repository: ${{ env.REPO }}

- uses: debdutdeb/semis@main

- name: 'Prepare for next steps'
id: prepare
shell: bash
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 5357b91

Please sign in to comment.