Skip to content

Commit

Permalink
ci: split workflow to smaller actions
Browse files Browse the repository at this point in the history
  • Loading branch information
variar committed Jun 8, 2022
1 parent 56d08c2 commit e3e9b24
Show file tree
Hide file tree
Showing 5 changed files with 247 additions and 217 deletions.
123 changes: 123 additions & 0 deletions .github/actions/agent-package-mac/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: "Prepare klogg mac packages"
description: ""
inputs:
p12-file-base64:
required: true
p12-password:
required: true
appstore-connect-username:
required: true
appstore-connect-password:
required: true

runs:
using: "composite"
steps:
- name: Mac prepare codesign
id: prepare-codesign
if: ${{ github.event_name != 'pull_request' }}
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ inputs.p12-file-base64 }}
p12-password: ${{ inputs.p12-password }}

- name: Mac deploy Qt
shell: sh
run: |
cd $KLOGG_BUILD_ROOT
macdeployqt ./output/klogg.app -always-overwrite -verbose=2
- name: Mac deploy Qt fixing
if: ${{ matrix.config.artifacts_id == 'qt5' }}
shell: sh
run: |
python2 $KLOGG_BUILD_ROOT/macdeployqtfix.py $KLOGG_BUILD_ROOT/output/klogg.app/Contents/MacOS/klogg $Qt5_DIR
- name: Mac deploy Qt fixing
if: ${{ matrix.config.artifacts_id == 'qt6' }}
shell: sh
run: |
python2 $KLOGG_BUILD_ROOT/macdeployqtfix.py $KLOGG_BUILD_ROOT/output/klogg.app/Contents/MacOS/klogg $Qt6_DIR
- name: Set packaging env
shell: sh
run: |
echo "KLOGG_CODESIGN=Developer ID Application: Anton Filimonov (GAW773U324)" >> $GITHUB_ENV
echo "KLOGG_INSTALLERSIGN=Developer ID Installer: Anton Filimonov (GAW773U324)" >> $GITHUB_ENV
echo "KLOGG_DMG=klogg-${{ env.KLOGG_VERSION }}-OSX-${{ matrix.config.package_suffix }}.dmg" >> $GITHUB_ENV
echo "KLOGG_PKG=klogg-${{ env.KLOGG_VERSION }}-OSX-${{ matrix.config.package_suffix }}.pkg" >> $GITHUB_ENV
- name: Mac codesign binaries
if: ${{ github.event_name != 'pull_request' }}
shell: sh
run: |
cd $KLOGG_BUILD_ROOT
codesign -v -f -o runtime --deep --timestamp -s "${{ env.KLOGG_CODESIGN }}" ./output/klogg.app;
- name: Mac pack dmg
shell: sh
run: |
cd $KLOGG_BUILD_ROOT
cpack --verbose -G "DragNDrop"
- name: Mac codesign dmg
if: ${{ github.event_name != 'pull_request' }}
shell: sh
run: |
cd $KLOGG_BUILD_ROOT
mv ./packages/klogg-${{ env.KLOGG_VERSION }}-OSX.dmg ./packages/${{ env.KLOGG_DMG }}
codesign -v -f -o runtime --timestamp -s "${{ env.KLOGG_CODESIGN }}" ./packages/${{ env.KLOGG_DMG }}
- name: "Mac build pkg"
if: ${{ github.event_name != 'pull_request' }}
shell: sh
run: |
cd $KLOGG_BUILD_ROOT
mkdir -p pkg_resources/en.lproj
cp ../COPYING pkg_resources/en.lproj
cp ../packaging/description.txt pkg_resources/en.lproj
sed -e s/%klogg_version%/${{ env.KLOGG_VERSION }}/ -e s/%klogg_pkg%/klogg-${{ env.KLOGG_VERSION }}-OSX.pkg/ ../packaging/osx/distribution.xml > distribution.xml
pkgbuild --component ./output/klogg.app --install-location /Applications --version ${{ env.KLOGG_VERSION }} --sign "${{ env.KLOGG_INSTALLERSIGN }}" --timestamp ./output/klogg-${{ env.KLOGG_VERSION }}-OSX.pkg
productbuild --package-path ./output --distribution distribution.xml --resources ./pkg_resources --sign "${{ env.KLOGG_INSTALLERSIGN }}" --timestamp ./output/klogg-${{ env.KLOGG_VERSION }}-OSX-product.pkg
pkgutil --expand ./output/klogg-${{ env.KLOGG_VERSION }}-OSX-product.pkg ./output/klogg_product_pkg
pkgutil --flatten ./output/klogg_product_pkg ./output/klogg-${{ env.KLOGG_VERSION }}-OSX-flatten.pkg
productsign --sign "${{ env.KLOGG_INSTALLERSIGN }}" --timestamp ./output/klogg-${{ env.KLOGG_VERSION }}-OSX-flatten.pkg ./packages/${{ env.KLOGG_PKG }}
- name: "Mac notarize DMG"
if: ${{ github.event_name != 'pull_request' }}
uses: variar/xcode-notarize@v1.0.3
with:
verbose: true
product-path: "${{ env.KLOGG_BUILD_ROOT }}/packages/${{ env.KLOGG_DMG }}"
primary-bundle-id: "dev.filimonov.klogg"
appstore-connect-username: ${{ inputs.appstore-connect-username }}
appstore-connect-password: ${{ inputs.appstore-connect-password }}

- name: "Mac staple DMG"
if: ${{ github.event_name != 'pull_request' }}
uses: devbotsxyz/xcode-staple@v1
with:
product-path: "${{ env.KLOGG_BUILD_ROOT }}/packages/${{ env.KLOGG_DMG }}"

- name: "Mac notarize PKG"
if: ${{ github.event_name != 'pull_request' }}
uses: variar/xcode-notarize@v1.0.3
with:
verbose: true
product-path: "${{ env.KLOGG_BUILD_ROOT }}/packages/${{ env.KLOGG_PKG }}"
primary-bundle-id: "dev.filimonov.klogg"
appstore-connect-username: ${{ inputs.appstore-connect-username }}
appstore-connect-password: ${{ inputs.appstore-connect-password }}

- name: "Mac staple PKG"
if: ${{ github.event_name != 'pull_request' }}
uses: devbotsxyz/xcode-staple@v1
with:
product-path: "${{ env.KLOGG_BUILD_ROOT }}/packages/${{ env.KLOGG_PKG }}"

- name: Mac symbols
shell: sh
run: |
cd $KLOGG_BUILD_ROOT
cp -a ./output/klogg.dSym ./packages/klogg-${{ matrix.config.package_suffix }}.dSym
cp -a ./output/klogg.app ./packages/klogg-${{ matrix.config.package_suffix }}.app
58 changes: 58 additions & 0 deletions .github/actions/agent-package-win/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: "Prepare windows packages"
description: ""
inputs:
s3-key-id:
required: true
s3-secret:
required: true
s3-bucket:
required: true
runs:
using: "composite"
steps:
- name: Setup codesing env
if: ${{ github.event_name != 'pull_request' }}
shell: sh
run: |
echo "CS_CLIENT_S3_KEY_ID=${{ inputs.s3-key-id }}" >> $GITHUB_ENV
echo "CS_CLIENT_S3_SECRET=${{ inputs.s3-secret }}" >> $GITHUB_ENV
echo "CS_CLIENT_S3_BUCKET=${{ inputs.s3-bucket }}" >> $GITHUB_ENV
- name: Win codesign executables
if: ${{ github.event_name != 'pull_request' }}
shell: cmd
run: |
packaging\windows\codesign_client.exe --debug %KLOGG_BUILD_ROOT%\output\klogg.exe
packaging\windows\codesign_client.exe --debug %KLOGG_BUILD_ROOT%\output\klogg_portable.exe
packaging\windows\codesign_client.exe --debug %KLOGG_BUILD_ROOT%\output\klogg_crashpad_handler.exe
packaging\windows\codesign_client.exe --debug %KLOGG_BUILD_ROOT%\output\klogg_minidump_dump.exe
packaging\windows\codesign_client.exe --debug %KLOGG_BUILD_ROOT%\output\tbb12.dll
packaging\windows\codesign_client.exe --debug %KLOGG_BUILD_ROOT%\output\tbbmalloc.dll
packaging\windows\codesign_client.exe --debug %KLOGG_BUILD_ROOT%\output\tbbmalloc_proxy.dll

- name: Win portable
shell: cmd
run: |
packaging\windows\prepare_release.cmd
- name: Win installer
uses: joncloud/makensis-action@v3.3
with:
script-file: klogg.nsi
arguments: "-DVERSION=%KLOGG_VERSION% -DPLATFORM=%KLOGG_ARCH%"

- name: Win package
shell: cmd
run: |
md %KLOGG_BUILD_ROOT%\packages
xcopy klogg-%KLOGG_VERSION%-%KLOGG_ARCH%-portable.zip %KLOGG_BUILD_ROOT%\packages\ /y
xcopy klogg-%KLOGG_VERSION%-%KLOGG_ARCH%-pdb.zip %KLOGG_BUILD_ROOT%\packages\ /y
xcopy klogg-%KLOGG_VERSION%-%KLOGG_ARCH%-setup.exe %KLOGG_BUILD_ROOT%\packages\ /y
- name: Win codesign installer
if: ${{ github.event_name != 'pull_request' }}
shell: cmd
run: |
packaging\windows\codesign_client.exe --debug %KLOGG_BUILD_ROOT%\packages\klogg-%KLOGG_VERSION%-%KLOGG_ARCH%-setup.exe
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
name: "Setup boost"
description: "Set boost url, target location and downloads if needed"
name: "Setup agent"
description: ""
runs:
using: "composite"
steps:
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master

- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ matrix.config.qt_version }}-QtCache

- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.config.qt_version }}
arch: ${{ matrix.config.qt_arch }}
cached: ${{ steps.cache-qt.outputs.cache-hit }}
modules: ${{ matrix.config.qt_modules }}

- name: Set boost env vars
shell: sh
Expand Down
35 changes: 35 additions & 0 deletions .github/actions/docker-package/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Create a package"
description: "Creates a package from build output"
runs:
using: "composite"
steps:
- name: package
if: ${{ matrix.config.cpack_gen }}
shell: sh
run: |
docker run -v "$KLOGG_WORKSPACE":/usr/local ${{ matrix.config.container }} /bin/bash -c "cd /usr/local/build_root && cpack -G ${{ matrix.config.cpack_gen }} "
docker run --env KLOGG_VERSION=$KLOGG_VERSION -v "$KLOGG_WORKSPACE":/usr/local ${{ matrix.config.container }} /bin/bash -c "cd /usr/local/build_root && mv ./packages/klogg-$KLOGG_VERSION-Linux.${{ matrix.config.package_suffix }} ./packages/klogg-$KLOGG_VERSION-${{ matrix.config.artifacts_id }}.${{ matrix.config.package_suffix }}"
docker run --env KLOGG_VERSION=$KLOGG_VERSION -v "$KLOGG_WORKSPACE":/usr/local ${{ matrix.config.container }} /bin/bash -c "cd /usr/local/build_root && mv ./packages/klogg-$KLOGG_VERSION-Linux.${{ matrix.config.package_suffix }}.sha256 ./packages/klogg-$KLOGG_VERSION-${{ matrix.config.artifacts_id }}.${{ matrix.config.package_suffix }}.sha256"
- name: Check package
if: ${{ matrix.config.check_command }}
shell: sh
run: |
docker run --rm -v "$KLOGG_WORKSPACE/$KLOGG_BUILD_ROOT/packages":/usr/local ${{ matrix.config.check_container }} /bin/bash -c "${{ matrix.config.check_command }}"
- name: Linux AppImage
if: ${{ matrix.config.os == 'ubuntu_appimage' }}
shell: sh
run: |
docker run --device /dev/fuse --privileged --env KLOGG_VERSION=$KLOGG_VERSION -v "$KLOGG_WORKSPACE":/usr/local ${{ matrix.config.container }} /bin/bash -c "cd /usr/local/build_root && ../packaging/linux/appimage/generate_appimage.sh"
- name: Copy sym
shell: sh
run: |
docker run -v "$KLOGG_WORKSPACE":/usr/local ${{ matrix.config.container }} /bin/bash -c "cd /usr/local/build_root && cp ./output/klogg.sym ./packages/klogg_${{ matrix.config.artifacts_id }}.sym"
- name: Copy deps
if: ${{ matrix.config.os == 'ubuntu_appimage' }}
shell: sh
run: |
docker run -v "$KLOGG_WORKSPACE":/usr/local ${{ matrix.config.container }} /bin/bash -c "cd /usr/local && tar -czvf ./build_root/packages/klogg_deps.tar.gz ./cpm_cache"
Loading

0 comments on commit e3e9b24

Please sign in to comment.