diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1f7f65d..0b21534 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -139,7 +139,7 @@ jobs: push_to_registry: name: Build Docker image - if: startsWith(github.ref, 'refs/tags/') == false && github.event_name == 'push' + if: github.event_name == 'push' runs-on: ubuntu-latest needs: - "cross" @@ -183,11 +183,19 @@ jobs: - name: Get tag name if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }} id: tags + shell: bash run: | - branch="$(echo "${GITHUB_REF#refs/heads/}" | sed -E 's|[/]|-|g')" - tags="${REPO_NAME}:${branch}" - if [ "${branch}" == "master" ]; then - tags="${tags},${REPO_NAME}:latest" + startsWith(github.ref, 'refs/tags/') + tags="" + if [[ "${GITHUB_REF}" =~ ^'refs/tags/'(.*) ]]; then + gittag="$(echo "${BASH_REMATCH[1]}" | sed -E 's|[/]|-|g')" + tags=""${REPO_NAME}:${gittag}" + elif [[ "${GITHUB_REF}" =~ ^'refs/heads/'(.*) ]]; then + branch="$(echo "${BASH_REMATCH[1]}" | sed -E 's|[/]|-|g')" + tags="${REPO_NAME}:${branch}" + if [ "${branch}" == "master" ]; then + tags="${tags},${REPO_NAME}:latest" + fi fi echo "TAGS=${tags}" >> $GITHUB_OUTPUT env: diff --git a/Cargo.lock b/Cargo.lock index 552a254..970afd5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1113,7 +1113,7 @@ dependencies = [ [[package]] name = "neolink" -version = "0.5.7" +version = "0.5.8" dependencies = [ "anyhow", "byte-slice-cast", @@ -1142,7 +1142,7 @@ dependencies = [ [[package]] name = "neolink_core" -version = "0.5.6" +version = "0.5.8" dependencies = [ "aes", "assert_matches", diff --git a/Cargo.toml b/Cargo.toml index c98fcb6..32edeb3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "neolink" description = "A standards-compliant bridge to Reolink IP cameras" -version = "0.5.7" +version = "0.5.8" authors = ["George Hilliard ", "Andrew King "] edition = "2018" license = "AGPL-3.0-or-later" @@ -24,7 +24,7 @@ gstreamer-rtsp = "0.20.0" gstreamer-rtsp-server = { version = "0.20.3", features = ["v1_16"] } lazy_static = "1.4.0" log = { version = "0.4.17" } -neolink_core = { path = "crates/core", version = "0.5.6" } +neolink_core = { path = "crates/core", version = "0.5.8" } regex = "1.7.3" rumqttc = "0.20.0" serde = { version = "1.0.160", features = ["derive"] } diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index 696da57..9a6ecb4 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "neolink_core" description = "Core services and structure for Reolink IP cameras" -version = "0.5.6" +version = "0.5.8" authors = ["George Hilliard ", "Andrew King "] edition = "2018" license = "AGPL-3.0-or-later"