Skip to content

Commit 69dd739

Browse files
committed
fix Published releases must have a valid tag
1 parent 03bd606 commit 69dd739

File tree

6 files changed

+65
-66
lines changed

6 files changed

+65
-66
lines changed

.github/workflows/publish-github-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
# git describe --tags --always | awk -F . '{printf "RELEASE_VERSION=%s.%d",$1,$2+1}' | xargs > constants.env
2121
# git describe --tags --always | awk -F - '{printf "RELEASE_VERSION=V1.0-%s",$NF}' | xargs > constants.env
2222
d=$(date +'%y%m%d%H%M%S')
23-
grep IJK_VERSION= download-pre.sh | awk -F = '{printf "RELEASE_VERSION=%s-$s",$2,$d}' | xargs > constants.env
23+
grep IJK_VERSION= init-cfgs/ijk | awk -v d="$d" -F = '{printf "RELEASE_VERSION=%s-%s",$2,d}' | xargs > constants.env
2424
echo 'EDITION=github' >> constants.env
2525
cat constants.env
2626
- name: Export Env

.github/workflows/publish-ijk-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
# git describe --tags --always | awk -F . '{printf "RELEASE_VERSION=%s.%d",$1,$2+1}' | xargs > constants.env
2121
# git describe --tags --always | awk -F - '{printf "RELEASE_VERSION=V1.0-%s",$NF}' | xargs > constants.env
2222
d=$(date +'%y%m%d%H%M%S')
23-
grep IJK_VERSION= download-pre.sh | awk -F = '{printf "RELEASE_VERSION=%s-$s",$2,$d}' | xargs > constants.env
23+
grep IJK_VERSION= init-cfgs/ijk | awk -v d="$d" -F = '{printf "RELEASE_VERSION=%s-%s",$2,d}' | xargs > constants.env
2424
echo 'EDITION=ijk' >> constants.env
2525
cat constants.env
2626
- name: Export Env

download-pre.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
# limitations under the License.
1616
#
1717

18-
IJK_VERSION=0.10.0
19-
2018
set -e
2119

2220
EDITION=$1

init-any.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ if [[ "x$LIBS" == "x" || "$LIBS" == "all" ]]; then
5151
fi
5252

5353
if [[ "$PLAT" == 'ios' || "$PLAT" == 'macos' || "$PLAT" == 'all' ]]; then
54+
source "$c_dir/init-cfgs/ijk"
5455
for lib in $LIBS
5556
do
5657
echo "===[init $lib]===================="

init-cfgs/ijk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export IJK_VERSION=0.10.0

tools/init-repo.sh

Lines changed: 61 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ echo "===check env end==="
3434
PLAT=$2
3535
ARCH=$3
3636

37-
if [[ "$ARCH" == 'all' || "x$ARCH" == 'x' ]];then
37+
if [[ "$ARCH" == 'all' || "x$ARCH" == 'x' ]]; then
3838
iOS_ARCHS="x86_64 arm64"
3939
macOS_ARCHS="x86_64 arm64"
40-
elif [[ "$ARCH" == 'x86_64' || "$ARCH" == 'arm64' ]];then
40+
elif [[ "$ARCH" == 'x86_64' || "$ARCH" == 'arm64' ]]; then
4141
iOS_ARCHS="$ARCH"
4242
macOS_ARCHS="$ARCH"
4343
else
@@ -47,24 +47,24 @@ fi
4747

4848
function pull_common() {
4949
echo "== pull $REPO_DIR base =="
50-
if [[ -d "$GIT_LOCAL_REPO" ]];then
50+
if [[ -d "$GIT_LOCAL_REPO" ]]; then
5151
cd "$GIT_LOCAL_REPO"
5252
[[ -d .git/rebase-apply ]] && git am --skip
5353
git reset --hard
54-
54+
5555
local origin=$(git remote get-url origin)
5656
if [[ "$origin" != "$GIT_UPSTREAM" ]]; then
5757
git remote remove origin
5858
git remote add origin "$GIT_UPSTREAM"
5959
echo "force update origin to: $GIT_UPSTREAM"
6060
fi
61-
if [[ "$SKIP_PULL_BASE" ]];then
61+
if [[ "$SKIP_PULL_BASE" ]]; then
6262
echo "skip pull $REPO_DIR because you set SKIP_PULL_BASE env."
6363
else
6464
git fetch --all --tags
6565
fi
6666
else
67-
if [[ "$SKIP_PULL_BASE" ]];then
67+
if [[ "$SKIP_PULL_BASE" ]]; then
6868
echo "== local repo $REPO_DIR not exist,must clone by net firstly. =="
6969
echo "try:unset SKIP_PULL_BASE"
7070
exit -1
@@ -73,29 +73,28 @@ function pull_common() {
7373
cd "$GIT_LOCAL_REPO"
7474
fi
7575
fi
76-
76+
7777
# fix fatal: 'stable' is not a commit and a branch 'localBranch' cannot be created from it
78-
git checkout ${GIT_COMMIT} -B localBranch
79-
cd - > /dev/null
78+
git checkout ${GIT_COMMIT} -B localBranch
79+
cd - >/dev/null
8080
}
8181

82-
function apply_patches()
83-
{
84-
if [[ "$SKIP_FFMPEG_PATHCHES" && $REPO_DIR == 'ffmpeg' ]];then
82+
function apply_patches() {
83+
if [[ "$SKIP_FFMPEG_PATHCHES" && $REPO_DIR == 'ffmpeg' ]]; then
8584
echo "skip apply $REPO_DIR patches,because you set SKIP_FFMPEG_PATHCHES env."
86-
return
85+
return
8786
fi
8887

8988
local plat="$1"
9089
local patch_dir="${TOOLS}/../extra/patches/$REPO_DIR"
9190

92-
if [[ -d "${patch_dir}_${plat}" ]];then
91+
if [[ -d "${patch_dir}_${plat}" ]]; then
9392
patch_dir="${patch_dir}_${plat}"
9493
fi
95-
if [[ -d "$patch_dir" ]];then
94+
if [[ -d "$patch_dir" ]]; then
9695
echo
9796
echo "== Applying patches: $(basename $patch_dir)$(basename $PWD) =="
98-
git am $patch_dir/*.patch
97+
git am --keep $patch_dir/*.patch
9998
if [[ $? -ne 0 ]]; then
10099
echo 'Apply patches failed!'
101100
git am --skip
@@ -110,12 +109,16 @@ function make_arch_repo() {
110109
echo "== copy $REPO_DIR$dest_repo =="
111110
$TOOLS/copy-local-repo.sh $GIT_LOCAL_REPO $dest_repo
112111
cd $dest_repo
113-
if [[ "$GIT_WITH_SUBMODULE" ]];then
112+
if [[ "$GIT_WITH_SUBMODULE" ]]; then
114113
git submodule update --init --depth=1
115114
fi
116115
echo "last commit:"$(git log -1 --pretty=format:"[%h] %s:%ce %cd")
116+
if [[ -n "$IJK_VERSION" ]]; then
117+
git tag "ff${GIT_COMMIT##*/}-ijk$IJK_VERSION"
118+
fi
117119
apply_patches $1
118-
cd - > /dev/null
120+
echo "tag:$(git describe --tags)"
121+
cd - >/dev/null
119122
}
120123

121124
function usage() {
@@ -125,55 +128,51 @@ function usage() {
125128

126129
function main() {
127130
case "$1" in
128-
iOS|ios)
129-
pull_common
130-
found=0
131-
for arch in $iOS_ARCHS
132-
do
133-
if [[ "$2" == "$arch" || "x$2" == "x" || "$2" == "all" ]];then
134-
found=1
135-
make_arch_repo 'ios' $arch
136-
fi
137-
done
138-
139-
if [[ found -eq 0 ]];then
140-
echo "unknown arch:$2 for $1"
131+
iOS | ios)
132+
pull_common
133+
found=0
134+
for arch in $iOS_ARCHS; do
135+
if [[ "$2" == "$arch" || "x$2" == "x" || "$2" == "all" ]]; then
136+
found=1
137+
make_arch_repo 'ios' $arch
141138
fi
139+
done
140+
141+
if [[ found -eq 0 ]]; then
142+
echo "unknown arch:$2 for $1"
143+
fi
142144
;;
143-
144-
macOS|macos)
145-
146-
pull_common
147-
found=0
148-
for arch in $macOS_ARCHS
149-
do
150-
if [[ "$2" == "$arch" || "x$2" == "x" || "$2" == "all" ]];then
151-
found=1
152-
make_arch_repo 'macos' $arch
153-
fi
154-
done
155-
156-
if [[ found -eq 0 ]];then
157-
echo "unknown arch:$2 for $1"
145+
146+
macOS | macos)
147+
148+
pull_common
149+
found=0
150+
for arch in $macOS_ARCHS; do
151+
if [[ "$2" == "$arch" || "x$2" == "x" || "$2" == "all" ]]; then
152+
found=1
153+
make_arch_repo 'macos' $arch
158154
fi
155+
done
156+
157+
if [[ found -eq 0 ]]; then
158+
echo "unknown arch:$2 for $1"
159+
fi
159160
;;
160-
161-
all)
162-
pull_common
163-
for arch in $iOS_ARCHS
164-
do
165-
make_arch_repo 'ios' $arch
166-
done
167-
168-
for arch in $macOS_ARCHS
169-
do
170-
make_arch_repo 'macos' $arch
171-
done
161+
162+
all)
163+
pull_common
164+
for arch in $iOS_ARCHS; do
165+
make_arch_repo 'ios' $arch
166+
done
167+
168+
for arch in $macOS_ARCHS; do
169+
make_arch_repo 'macos' $arch
170+
done
172171
;;
173-
174-
*)
175-
usage
176-
exit 1
172+
173+
*)
174+
usage
175+
exit 1
177176
;;
178177
esac
179178
}

0 commit comments

Comments
 (0)