Skip to content

Commit da9f53b

Browse files
committed
refactor how to ignore the beta tag for versioning
1 parent 6f0ea10 commit da9f53b

File tree

8 files changed

+5
-45
lines changed

8 files changed

+5
-45
lines changed

.github/workflows/build-appimage.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ jobs:
1717
with:
1818
fetch-depth: 0
1919
submodules: true
20-
- name: Get Git tag description
21-
id: git_info
22-
run: |
23-
git tag -d beta 2>/dev/null || echo "Tag 'beta' not found"
24-
echo "GIT_TAG=$(git describe --tags --always --long)" >> $GITHUB_ENV
2520

2621
- name: Install Build Dependencies
2722
run: |

.github/workflows/build-appx.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@ jobs:
1818
with:
1919
fetch-depth: 0
2020
submodules: true
21-
- name: Delete beta tag
22-
shell: bash
23-
run: |
24-
if git tag | grep -q '^beta$'; then
25-
git tag -d beta
26-
fi
27-
- name: Get Git tag description
28-
id: git_info
29-
run: |
30-
echo "GIT_TAG=$(git describe --tags --always --long)" >> $GITHUB_ENV
3121
- uses: lukka/get-cmake@latest
3222
- uses: ilammy/msvc-dev-cmd@v1
3323

.github/workflows/build-flatpak.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ jobs:
2626
id: git_info
2727
run: |
2828
git config --global --add safe.directory $(pwd)
29-
git tag -d beta 2>/dev/null || echo "Tag 'beta' not found"
30-
VERSION=$(git tag --points-at HEAD | grep '^v' | sed 's/^v//' || true)
31-
VERSION=${VERSION:-$(git rev-parse --short HEAD || true)}
29+
VERSION=$(git tag --points-at HEAD | grep -v '^beta$' | sed 's/^v//' | head -n 1 || true)
30+
VERSION=${VERSION:-$(git describe --tags --always --long --exclude beta | sed 's/^v//' || true)}
3231
VERSION=${VERSION:-$(cat MMAPPER_VERSION)}
3332
ARCHITECTURE=$(uname -m)
3433
FILE="org.mume.MMapper-${VERSION}-Linux-${ARCHITECTURE}.flatpak"

.github/workflows/build-release.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@ jobs:
2222
with:
2323
fetch-depth: 0
2424
submodules: true
25-
- name: Delete beta tag
26-
shell: bash
27-
run: |
28-
if git tag | grep -q '^beta$'; then
29-
git tag -d beta
30-
fi
31-
- name: Get Git tag description
32-
id: git_info
33-
run: |
34-
echo "GIT_TAG=$(git describe --tags --always --long)" >> $GITHUB_ENV
3525
- if: runner.os == 'Windows' || runner.os == 'macOS'
3626
uses: lukka/get-cmake@latest
3727
- if: runner.os == 'Windows'

.github/workflows/build-test.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,6 @@ jobs:
3030
with:
3131
fetch-depth: 0
3232
submodules: true
33-
- name: Delete beta tag
34-
shell: bash
35-
run: |
36-
if git tag | grep -q '^beta$'; then
37-
git tag -d beta
38-
fi
39-
- name: Get Git tag description
40-
id: git_info
41-
run: |
42-
echo "GIT_TAG=$(git describe --tags --always --long)" >> $GITHUB_ENV
4333
- if: runner.os == 'Windows' || runner.os == 'macOS'
4434
uses: lukka/get-cmake@latest
4535
- if: matrix.compiler == 'msvc'

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@ if(EXISTS "${PROJECT_SOURCE_DIR}/.git")
126126

127127
# Describe the most recent tag, number of commits since, and abbreviated commit hash
128128
execute_process(
129-
COMMAND ${GIT_EXECUTABLE} describe --tags --always --long
129+
COMMAND ${GIT_EXECUTABLE} describe --tags --always --long --exclude beta
130130
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
131131
OUTPUT_VARIABLE GIT_TAG_COMMIT_HASH
132132
OUTPUT_STRIP_TRAILING_WHITESPACE
133133
)
134134

135135
# Detect if this checkout is a tag and extract its name if so
136136
execute_process(
137-
COMMAND ${GIT_EXECUTABLE} name-rev --name-only --tags --no-undefined HEAD
137+
COMMAND ${GIT_EXECUTABLE} name-rev --name-only --tags --no-undefined HEAD --exclude beta
138138
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
139139
OUTPUT_VARIABLE GIT_TAG_NAME
140140
OUTPUT_STRIP_TRAILING_WHITESPACE

org.mume.MMapper.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,6 @@
134134
"path": "."
135135
}
136136
],
137-
"build-commands": [
138-
"git tag -d beta || true"
139-
],
140137
"config-opts": [
141138
"-DCMAKE_BUILD_TYPE=Release",
142139
"-DWITH_WEBSOCKET=ON",

snapcraft.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ parts:
7373
- zlib1g
7474
override-pull: |
7575
craftctl default
76-
git tag -d beta 2>/dev/null || echo "Tag 'beta' not found"
77-
craftctl set version=$(git describe --tags --always --long)
76+
craftctl set version=$(git describe --tags --always --long --exclude beta | sed 's/^v//')
7877
override-build: |
7978
craftctl default
8079
sed -i 's|Icon=org.mume.MMapper|Icon=${SNAP}/usr/share/icons/hicolor/256x256/apps/org.mume.MMapper.png|g' $CRAFT_PART_INSTALL/usr/share/applications/org.mume.MMapper.desktop

0 commit comments

Comments
 (0)