mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-08 13:34:59 +00:00
Compare commits
2 Commits
master
...
fix/freebs
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4257cd970 | ||
|
|
a0f2fef31a |
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -72,6 +72,8 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: ./ccextractor
|
||||
- name: Generate version info for this release
|
||||
run: ./ccextractor/linux/generate_version_info.sh
|
||||
- name: Create .tar.gz without git and windows folders
|
||||
run: tar -pczf ./ccextractor_minimal.tar.gz --exclude "ccextractor/windows" --exclude "ccextractor/.git" ccextractor
|
||||
- name: Upload as asset
|
||||
|
||||
13
linux/generate_date_info.sh
Normal file
13
linux/generate_date_info.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
builddate=`date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d`
|
||||
echo "Storing variables in file"
|
||||
echo "Date: $builddate"
|
||||
# Only append if it does not exist yet in the file
|
||||
already_in_there=$(grep "CCX_CCEXTRACTOR_COMPILE_REAL_TIME_H" ../src/lib_ccx/compile_info_real.h 2>/dev/null)
|
||||
if [ ! -z "$already_in_there" ]; then
|
||||
echo "#ifndef CCX_CCEXTRACTOR_COMPILE_REAL_TIME_H" > ../src/lib_ccx/compile_info_real.h
|
||||
echo "#define CCX_CCEXTRACTOR_COMPILE_REAL_TIME_H" >> ../src/lib_ccx/compile_info_real.h
|
||||
echo "#define COMPILE_DATE \"$builddate\"" >> ../src/lib_ccx/compile_info_real.h
|
||||
echo "#endif" >> ../src/lib_ccx/compile_info_real.h
|
||||
endif
|
||||
echo "Done."
|
||||
34
linux/generate_version_info.sh
Normal file
34
linux/generate_version_info.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
echo "Obtaining Git commit"
|
||||
commit=(`git rev-parse HEAD 2>/dev/null`)
|
||||
if [ -z "$commit" ]; then
|
||||
echo "Git command not present, trying folder approach"
|
||||
if [ -d "../.git" ]; then
|
||||
echo "Git folder found, using HEAD file"
|
||||
head="`cat ../.git/HEAD`"
|
||||
ref_pos=(`expr match "$head" 'ref: '`)
|
||||
if [ $ref_pos -eq 5 ]; then
|
||||
echo "HEAD file contains a ref, following"
|
||||
commit=(`cat "../.git/${head:5}"`)
|
||||
echo "Extracted commit: $commit"
|
||||
else
|
||||
echo "HEAD contains a commit, using it"
|
||||
commit="$head"
|
||||
echo "Extracted commit: $commit"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ -z "$commit" ]; then
|
||||
commit="Unknown"
|
||||
fi
|
||||
echo "Storing variables in file"
|
||||
echo "Commit: $commit"
|
||||
# Only append if it does not exist yet in the file
|
||||
already_in_there=$(grep "CCX_CCEXTRACTOR_COMPILE_REAL_COMMIT_H" ../src/lib_ccx/compile_info_real.h 2>/dev/null)
|
||||
if [ ! -z "$already_in_there" ]; then
|
||||
echo "#ifndef CCX_CCEXTRACTOR_COMPILE_REAL_COMMIT_H" >> ../src/lib_ccx/compile_info_real.h
|
||||
echo "#define CCX_CCEXTRACTOR_COMPILE_REAL_COMMIT_H" >> ../src/lib_ccx/compile_info_real.h
|
||||
echo "#define GIT_COMMIT \"$commit\"" >> ../src/lib_ccx/compile_info_real.h
|
||||
echo "#endif" >> ../src/lib_ccx/compile_info_real.h
|
||||
endif
|
||||
echo "Done."
|
||||
@@ -1,34 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
echo "Obtaining Git commit"
|
||||
commit=(`git rev-parse HEAD 2>/dev/null`)
|
||||
if [ -z "$commit" ]; then
|
||||
echo "Git command not present, trying folder approach"
|
||||
if [ -d "../.git" ]; then
|
||||
echo "Git folder found, using HEAD file"
|
||||
head="`cat ../.git/HEAD`"
|
||||
ref_pos=(`expr match "$head" 'ref: '`)
|
||||
if [ $ref_pos -eq 5 ]; then
|
||||
echo "HEAD file contains a ref, following"
|
||||
commit=(`cat "../.git/${head:5}"`)
|
||||
echo "Extracted commit: $commit"
|
||||
else
|
||||
echo "HEAD contains a commit, using it"
|
||||
commit="$head"
|
||||
echo "Extracted commit: $commit"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ -z "$commit" ]; then
|
||||
commit="Unknown"
|
||||
fi
|
||||
builddate=`date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d`
|
||||
echo "Storing variables in file"
|
||||
echo "Commit: $commit"
|
||||
echo "Date: $builddate"
|
||||
echo "#ifndef CCX_CCEXTRACTOR_COMPILE_REAL_H" > ../src/lib_ccx/compile_info_real.h
|
||||
echo "#define CCX_CCEXTRACTOR_COMPILE_REAL_H" >> ../src/lib_ccx/compile_info_real.h
|
||||
echo "#define GIT_COMMIT \"$commit\"" >> ../src/lib_ccx/compile_info_real.h
|
||||
echo "#define COMPILE_DATE \"$builddate\"" >> ../src/lib_ccx/compile_info_real.h
|
||||
echo "#endif" >> ../src/lib_ccx/compile_info_real.h
|
||||
echo "Stored all in compile_info_real.h"
|
||||
echo "Done."
|
||||
./generate_version_info.sh
|
||||
./generate_date_info.sh
|
||||
|
||||
Reference in New Issue
Block a user