Skip to content

Commit 96c69fd

Browse files
committed
Refactor Github actions
1 parent 2820421 commit 96c69fd

File tree

3 files changed

+64
-63
lines changed

3 files changed

+64
-63
lines changed

.github/workflows/build.yaml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
fetch-depth: 0
2424

2525
- name: Get latest tag version
26-
run: echo "PACKAGE_VERSION=$(git describe --tags --abbrev=0 || echo 0.0.0)" >> $GITHUB_ENV
26+
run: echo "PACKAGE_VERSION=$(git describe --tags --abbrev=0 || echo 0.0.0)" >> "$GITHUB_ENV"
2727

2828
- name: Install dependencies
2929
run: |
@@ -67,7 +67,7 @@ jobs:
6767
python3 -m pip install --upgrade pip
6868
python3 -m pip install "aqtinstall<4"
6969
python3 -m aqt install-qt --outputdir "$HOME/Qt" linux desktop "$QT_VERSION" linux_gcc_64 -m qtwebsockets
70-
echo "$HOME/Qt/${QT_VERSION}/gcc_64/bin" >> $GITHUB_PATH
70+
echo "$HOME/Qt/${QT_VERSION}/gcc_64/bin" >> "$GITHUB_PATH"
7171
7272
- name: Download linuxdeployqt
7373
run: |
@@ -81,25 +81,25 @@ jobs:
8181
qmake6 --version
8282
qmake6 -query QT_INSTALL_LIBS
8383
mkdir -p build && cd build
84-
qmake6 ../src/${APP_NAME}.pro CONFIG+=release CONFIG+=static
85-
make -j$(nproc)
84+
qmake6 "../src/${APP_NAME}.pro" CONFIG+=release CONFIG+=static
85+
make "-j$(nproc)"
8686
8787
- name: Prepare AppDir for AppImage
8888
run: |
8989
APPDIR=AppDir
90-
mkdir -p $APPDIR/usr/bin
91-
mkdir -p $APPDIR/usr/share/applications
92-
mkdir -p $APPDIR/usr/share/icons/hicolor/256x256/apps
90+
mkdir -p "$APPDIR/usr/bin"
91+
mkdir -p "$APPDIR/usr/share/applications"
92+
mkdir -p "$APPDIR/usr/share/icons/hicolor/256x256/apps"
9393
9494
# Copy binary
95-
cp build/${APP_NAME} $APPDIR/usr/bin/
95+
cp "build/${APP_NAME}" "$APPDIR/usr/bin/"
9696
9797
# Convert .ico to .png and copy it
9898
cp resources/subtivals.png $APPDIR/subtivals.png
99-
convert resources/${APP_NAME}.ico -resize 256x256 $APPDIR/usr/share/icons/hicolor/256x256/apps/${APP_NAME}.png
99+
convert "resources/${APP_NAME}.ico" -resize 256x256 "$APPDIR/usr/share/icons/hicolor/256x256/apps/${APP_NAME}.png"
100100
101101
# Create .desktop file
102-
cat <<EOF > $APPDIR/usr/share/applications/${APP_NAME}.desktop
102+
cat <<EOF > "$APPDIR/usr/share/applications/${APP_NAME}.desktop"
103103
[Desktop Entry]
104104
Name=${APP_NAME}
105105
Exec=${APP_NAME}
@@ -110,29 +110,29 @@ jobs:
110110
111111
- name: Check dynamic dependencies
112112
run: |
113-
ldd $APPDIR/usr/bin/${APP_NAME} || true
113+
ldd "$APPDIR/usr/bin/${APP_NAME}" || true
114114
115115
- name: Run linuxdeployqt
116116
run: |
117-
linuxdeployqt AppDir/usr/share/applications/${APP_NAME}.desktop -appimage -bundle-non-qt-libs
117+
linuxdeployqt "AppDir/usr/share/applications/${APP_NAME}.desktop" -appimage -bundle-non-qt-libs
118118
119-
chmod +x *.AppImage
119+
chmod +x ./*.AppImage
120120
121121
# Rename output
122-
mv *.AppImage "${APP_NAME}-${PACKAGE_VERSION}.AppImage"
122+
mv ./*.AppImage "${APP_NAME}-${PACKAGE_VERSION}.AppImage"
123123
124124
- name: Check AppImage
125125
run: |
126-
./${APP_NAME}-${PACKAGE_VERSION}.AppImage --appimage-extract
127-
ldd squashfs-root/usr/bin/${APP_NAME}
126+
"./${APP_NAME}-${PACKAGE_VERSION}.AppImage" --appimage-extract
127+
ldd "squashfs-root/usr/bin/${APP_NAME}"
128128
129129
- name: Upload artifacts
130130
uses: actions/upload-artifact@v4
131131
with:
132-
name: ${{ env.APP_NAME }}-artifacts
132+
name: "${{ env.APP_NAME }}-artifacts"
133133
path: |
134-
build/${{ env.APP_NAME }}
135-
${{ env.APP_NAME }}-${{ env.PACKAGE_VERSION }}.AppImage
134+
"build/${{ env.APP_NAME }}"
135+
"${{ env.APP_NAME }}-${{ env.PACKAGE_VERSION }}.AppImage"
136136
137137
release:
138138
needs: build-linux
@@ -150,7 +150,7 @@ jobs:
150150
uses: softprops/action-gh-release@v2
151151
with:
152152
files: release/*
153-
tag_name: ${{ github.ref_name }}
153+
tag_name: "${{ github.ref_name }}"
154154
name: "Release ${{ github.ref_name }}"
155155
body: "Automated release for version ${{ github.ref_name }}"
156156
draft: true

.github/workflows/ci.yaml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,63 @@ on:
55
paths:
66
- '**/*.cpp'
77
- '**/*.h'
8+
- '**.ts'
9+
- '**.ui'
10+
- '.github/workflows/*.yaml'
811
push:
912
branches:
1013
- main
1114

1215
jobs:
16+
actions-lint:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Check workflow files
21+
run: |
22+
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
23+
./actionlint -color
24+
shell: bash
25+
1326
clang-format-lint:
1427
runs-on: ubuntu-latest
1528
steps:
1629
- name: Checkout code
17-
uses: actions/checkout@v3
30+
uses: actions/checkout@v4
1831

1932
- name: Install clang-format
2033
run: sudo apt-get install -y clang-format
2134

2235
- name: Check formatting
2336
run: |
2437
FILES=$(find . -regex '.*\.\(cpp\|h\)')
25-
clang-format --dry-run --Werror -style=file $FILES
38+
clang-format --dry-run --Werror -style=file "$FILES"
39+
40+
check-translations:
41+
runs-on: ubuntu-latest
42+
43+
env:
44+
QT_VERSION: 6.9.1
45+
46+
steps:
47+
- name: Checkout repository
48+
uses: actions/checkout@v4
49+
50+
- name: Set up Qt
51+
uses: jurplel/install-qt-action@v3
52+
with:
53+
version: ${{ env.QT_VERSION }}
54+
55+
- name: Generate .ts files with lupdate
56+
run: |
57+
lupdate src/ -ts locale/*.ts
58+
59+
- name: Check for unfinished translations
60+
run: |
61+
if grep -q 'type="unfinished"' locale/fr_FR.ts; then
62+
echo "::error ::Unfinished locale found:"
63+
grep -Hn 'type="unfinished"' locale/fr_FR.ts
64+
exit 1
65+
else
66+
echo "✅ All translations are complete."
67+
fi

.github/workflows/l10n.yaml

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)