Skip to content

Commit 508d945

Browse files
authored
Update c-cpp.yml
1 parent a360f8b commit 508d945

1 file changed

Lines changed: 23 additions & 8 deletions

File tree

.github/workflows/c-cpp.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,45 @@ jobs:
1111
- name: Checkout code
1212
uses: actions/checkout@v4
1313

14+
- name: Generate tag name (timestamp-based)
15+
id: tag
16+
run: |
17+
TAG_NAME="v1_$(date +%Y%m%d-%H%M%S)"
18+
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
19+
echo "tag=$TAG_NAME" >> $GITHUB_OUTPUT
20+
21+
- name: Create tag
22+
run: |
23+
git config user.name "github-actions"
24+
git config user.email "github-actions@github.com"
25+
git tag $TAG_NAME
26+
git push origin $TAG_NAME
27+
1428
- name: Build in Docker (manual Qt install)
1529
run: |
1630
docker run --rm -v $PWD:/workspace -w /workspace ubuntu:22.04 bash -c "
1731
apt-get update &&
1832
DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential qttools5-dev-tools libfuzzy-dev libssl-dev libelf-dev wget git qtbase5-dev qt6-base-dev qt6-base-dev-tools qt6-tools-dev qt6-tools-dev-tools &&
19-
if [ -f *.pro ]; then
20-
qmake *.pro
33+
if ls *.pro 1>/dev/null 2>&1; then
34+
qmake *.pro && make
2135
elif [ -f CMakeLists.txt ]; then
2236
cmake -B build && cmake --build build
23-
fi &&
24-
make || cmake --build build
37+
fi
2538
"
2639
2740
- name: Archive build
2841
run: |
2942
mkdir -p dist
30-
cp <your_binary> dist/ || true
43+
cp CuttieElf dist/ || true
3144
cp README.md dist/ || true
3245
cd dist
33-
tar -czvf ../MasterStringz.tar.gz * || true
46+
tar -czvf ../MasterStringz-${{ env.TAG_NAME }}.tar.gz * || true
3447
35-
- name: Create Release
48+
- name: Create GitHub Release
3649
uses: softprops/action-gh-release@v2
3750
with:
38-
files: MasterStringz.tar.gz
51+
tag_name: ${{ env.TAG_NAME }}
52+
name: Release ${{ env.TAG_NAME }}
53+
files: MasterStringz-${{ env.TAG_NAME }}.tar.gz
3954
env:
4055
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)