Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gsanchietti committed Feb 1, 2024
1 parent 17b72f0 commit b77b768
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ jobs:
NETIFYD_ACCESS_TOKEN: ${{ secrets.NETIFYD_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- id: Read tag
if: ${{ startsWith(github.ref, 'refs/tags') }}
run: |
# Set tag from GitHub: using git describe in this context seems not working
# even if the checkout has been done with fetch-depth set to 0
echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- id: build
name: Build the image
run: |
Expand Down
7 changes: 5 additions & 2 deletions run
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ if [ "$(podman ps -a --format '{{.Names}}')" == "nethsec-builder" ]; then
podman rm nethsec-builder
fi

# Setup version from git
# Use VERSION from the environment, need for CI
# VERSION has the following format: 8-<owrt_release>-ns.<nethsecurity_release>[-<commit_since_last_tag>-g<commit_hash>]
VERSION=$(git describe)
if [ -z "{$VERSION}" ]; then
# Setup version from git if the env var is not set
VERSION=$(git describe --tags)
fi
# OWRT_VERSION is like 23.05.2
OWRT_VERSION=$(echo $VERSION | cut -d'-' -f1)
# NS_VERSION is a semver release like '1.0.0' for stable and '1.0.0-alpha1' or '1.0.0-234-g1bc543c' for dev
Expand Down

0 comments on commit b77b768

Please sign in to comment.