Skip to content

Commit

Permalink
Merge branch 'flameshot-org:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jack9603301 authored May 28, 2024
2 parents 0c8cdca + a1dda59 commit 6d39344
Show file tree
Hide file tree
Showing 74 changed files with 7,537 additions and 1,096 deletions.
39 changes: 20 additions & 19 deletions .github/workflows/Linux-pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ jobs:
mkdir -p ~/.docker
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
sudo service docker restart
docker version -f '{{.Client.Experimental}}'
docker version -f '{{.Server.Experimental}}'
docker version -f "{{ (index .Server.Components 0).Details.Experimental }}"
docker buildx version
- name: Support for ARM via QEMU's user-mode emulation
# Register binfmt_misc entry for qemu-user-static
Expand Down Expand Up @@ -122,13 +121,13 @@ jobs:
fi
- name: Checkout Source code
if: github.event_name == 'push'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
- name: Checkout Source code
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
Expand All @@ -144,7 +143,7 @@ jobs:
echo "================================"
echo "VERSION=${last_committed_tag:1}" >> $GITHUB_ENV
- name: Get packpack tool
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ env.PACKPACK_REPO }}
path: tools
Expand Down Expand Up @@ -241,13 +240,13 @@ jobs:
steps:
- name: Checkout Source code
if: github.event_name == 'push'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
- name: Checkout Source code
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
Expand All @@ -263,7 +262,7 @@ jobs:
echo "================================"
echo "VERSION=${last_committed_tag:1}" >> $GITHUB_ENV
- name: Get packpack tool
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ env.PACKPACK_REPO }}
path: tools
Expand Down Expand Up @@ -327,7 +326,6 @@ jobs:
path: |
${{ github.workspace }}/build/${{ env.PRODUCT }}-*-lp${{ matrix.dist.symbol }}.${{ matrix.dist.arch }}.rpm
${{ github.workspace }}/build/${{ env.PRODUCT }}-*-lp${{ matrix.dist.symbol }}.${{ matrix.dist.arch }}.rpm.sha256sum
appimage-pack:
name: Build appimage on ${{ matrix.config.name }}
runs-on: ubuntu-22.04
Expand All @@ -353,13 +351,13 @@ jobs:
- name: Checkout Source code
if: github.event_name == 'push'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
- name: Checkout Source code
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
Expand Down Expand Up @@ -401,7 +399,6 @@ jobs:
ca-certificates \
jq
- name: Get go-appimage tool
# Will not use linuxdeployqt anymore, because it suopprts currently still-supported mainstream distribution,
# which is glibc 2.23. For more information, please see https://github.com/probonopd/linuxdeployqt/issues/340.
Expand All @@ -414,15 +411,16 @@ jobs:
APPIMAGETOOL_ARCH: x86_64
- name: Packaging appimage
run: |
set -x
APPIMAGE_DST_PATH=$GITHUB_WORKSPACE/${PRODUCT}.AppDir
mkdir -p ${APPIMAGE_DST_PATH}
cd $GITHUB_WORKSPACE
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -DUSE_LAUNCHER_ABSOLUTE_PATH:BOOL=OFF
make -j$(nproc) DESTDIR=${APPIMAGE_DST_PATH} install
$GITHUB_WORKSPACE/appimagetool -s deploy ${APPIMAGE_DST_PATH}/usr/share/applications/org.flameshot.Flameshot.desktop
$GITHUB_WORKSPACE/appimagetool -s deploy "${APPIMAGE_DST_PATH}/usr/share/applications/org.flameshot.Flameshot.desktop"
mkdir -p ${APPIMAGE_DST_PATH}/usr/plugins/platforminputcontexts
cp \
/usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so \
Expand All @@ -438,8 +436,11 @@ jobs:
chmod +x ${APPIMAGE_DST_PATH}/usr/lib64/ld-*.so.*
VERSION=${VERSION} $GITHUB_WORKSPACE/appimagetool ${APPIMAGE_DST_PATH}
VERSION=${VERSION} $GITHUB_WORKSPACE/appimagetool "${APPIMAGE_DST_PATH}"
mv $GITHUB_WORKSPACE/Flameshot-${VERSION}-x86_64.AppImage $GITHUB_WORKSPACE/Flameshot-${VERSION}.x86_64.AppImage
- name: SHA256Sum of appimage package(daily build)
run: |
cd "$GITHUB_WORKSPACE/" || { >&2 echo "Cannot cd to '$GITHUB_WORKSPACE/'!"; exit 11 ; }
Expand All @@ -466,13 +467,13 @@ jobs:
steps:
- name: Checkout Source code
if: github.event_name == 'push'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
- name: Checkout Source code
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
Expand Down Expand Up @@ -532,13 +533,13 @@ jobs:
steps:
- name: Checkout Source code
if: github.event_name == 'push'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
- name: Checkout Source code
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/MacOS-pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
DIR_PKG: build/src
HELPERS_SCRIPTS_PATH: ../../packaging/macos
# Apple developer identity, example: "Developer ID Application: <user name> (code)"
# Note: no signing and notarization will be be proceed if this variable is not set
# Note: no signing and notarization will be proceed if this variable is not set
APPLE_DEV_IDENTITY: ${{ secrets.APPLE_DEV_IDENTITY }}
# Apple ID user
APPLE_DEV_USER: ${{ secrets.APPLE_DEV_USER }}
Expand All @@ -45,22 +45,19 @@ jobs:

steps:
- name: Checkout Source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Qt
run: brew install qt@5 cmake

- name: Configure
run: |
mkdir -p "${DIR_BULD}"
cd "${DIR_BULD}"
rm -rf ./src/flameshot.dmg ./src/flameshot.app/
cmake .. -DQt5_DIR=$(brew --prefix qt5)/lib/cmake/Qt5 -DUSE_MONOCHROME_ICON=True
rm -rf "${DIR_BULD}"/src/flameshot.dmg "${DIR_BULD}"/src/flameshot.app/
cmake -S . -B "${DIR_BULD}" -DQt5_DIR=$(brew --prefix qt5)/lib/cmake/Qt5 -DUSE_MONOCHROME_ICON=True
- name: Compile
run: |
cd "${DIR_BULD}"
make
cmake --build "${DIR_BULD}"
- name: Create key-chain and import certificate
run: |
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/Windows-pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: Packaging(Windows)
on:
push:
branches:
- master*
- master
- fix*
paths-ignore:
- 'README.md'
- 'LICENSE'
Expand All @@ -12,6 +13,8 @@ on:
paths-ignore:
- 'README.md'
- 'LICENSE'
workflow_dispatch:


env:
PRODUCT: flameshot
Expand Down Expand Up @@ -54,14 +57,14 @@ jobs:
steps:
- name: Checkout Source code
if: github.event_name == 'push'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
# ref: master

- name: Checkout Source code
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
Expand All @@ -81,7 +84,7 @@ jobs:
echo "VERSION=$(cat CMakeLists.txt |grep 'set.*(.*FLAMESHOT_VERSION' | sed 's/[^0-9.]*//' |sed 's/)//g')" >> $GITHUB_ENV
- name: Restore from cache and run vcpkg
uses: lukka/run-vcpkg@v4
uses: lukka/run-vcpkg@v11
with:
vcpkgArguments: ${{env.VCPKG_PACKAGES}}
vcpkgDirectory: '${{ github.workspace }}\vcpkg'
Expand All @@ -91,13 +94,13 @@ jobs:

- name: Cache Qt
id: cache-qt
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./build/Qt/${{ matrix.qt_ver }}/${{ matrix.config.qt_arch_install }}
key: ${{ runner.os }}-QtCache/${{ matrix.qt_ver }}/${{ matrix.config.qt_arch }}

- name: Install Qt
uses: jurplel/install-qt-action@v2
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt_ver }}
target: ${{ matrix.qt_target }}
Expand Down Expand Up @@ -197,7 +200,7 @@ jobs:
echo $(python $GITHUB_WORKSPACE/scripts/upload_services/transferwee.py upload $GITHUB_WORKSPACE/build/Package/portable/flameshot-${VERSION}-${{ matrix.config.pak_arch }}.zip)
echo "=====no operation for you can see link in the log console====="
- name: Artifact Upload
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Windows-artifact
name: Windows-${{ matrix.config.arch }}-${{ matrix.type }}-artifact
path: ${{ github.workspace }}/build/Package/*
6 changes: 3 additions & 3 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:
steps:
- name: Checkout Source code
if: github.event_name == 'push'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Checkout Source code
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Cache Qt
id: cache-qt
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
steps:
- name: Checkout Source code
if: github.event_name == 'push'
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Checkout Source code
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: DoozyX/[email protected]
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/deploy-dev-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Deploy developer docs

on:
push:
branches: [ master, docs ]
paths:
- 'src/**'
- 'docs/dev/**'
- '.github/workflows/deploy-dev-docs.yml'

jobs:
build-and-deploy:
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
sudo apt-get --yes --quiet update
sudo apt-get --yes --no-install-recommends install doxygen
pip install \
mkdocs \
mkdocs-material \
git+https://github.com/veracioux/[email protected]
- name: Checkout flameshot source
uses: actions/checkout@v4
with:
path: 'flameshot'

- name: Build docs
working-directory: ${{github.workspace}}/flameshot/docs/dev
run: |
make build
- name: Checkout flameshot website
uses: actions/checkout@v4
with:
repository: 'flameshot-org/flameshot-org.github.io'
ref: 'gh-pages'
path: 'website'

- name: Configure git credentials for website repo
working-directory: ${{github.workspace}}/website
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git config http.https://github.com/.extraheader 'AUTHORIZATION basic ${{secrets.TOKEN_PUSH_TO_WEBSITE_REPO}}'
git remote add destination "https://x-access-token:${{secrets.TOKEN_PUSH_TO_WEBSITE_REPO}}@github.com/flameshot-org/flameshot-org.github.io"
- name: Add developer docs to website deployment
working-directory: ${{github.workspace}}/website
run: |
# Create empty dev-docs-staging branch
git checkout --orphan dev-docs-staging
git rm -r --cached .
rm -rf docs/dev
# Copy generated docs over
mkdir -p docs
mv "${{github.workspace}}/flameshot/docs/dev/output" \
"./docs/dev"
# Commit docs/dev to the dev-docs-staging branch
git add docs/dev
HASH="$(git --git-dir="${{github.workspace}}/flameshot/.git" rev-parse HEAD)"
git commit --message "Add developer docs from flameshot@$HASH"
# Apply changes to gh-pages
git checkout --force gh-pages
git checkout dev-docs-staging -- docs/dev
# Commit (we use `|| true` because the commit could be empty and thus fail)
git commit --message "Add developer docs from flameshot@$HASH" || true
- name: Push to website repo
working-directory: ${{github.workspace}}/website
run: |
git push --force destination dev-docs-staging
git push destination gh-pages
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,7 @@ data/flatpak/.flatpak-builder

#MacOS Crap
.DS_Store

# Miscellaneous
!docs/dev/Makefile
.direnv
Loading

0 comments on commit 6d39344

Please sign in to comment.