Skip to content

Build Release by wyzdwdz #277

Build Release by wyzdwdz

Build Release by wyzdwdz #277

Workflow file for this run

name: Build Release
run-name: Build Release by ${{ github.actor }}
on:
release:
types: [ published ]
push:
branches: [ qt6.8 ]
jobs:
build-linux:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
strategy:
matrix:
include:
- { arch: x86_64, profile: x64 }
- { arch: aarch64, profile: arm64 }
- { arch: armhf, profile: armv7l }
- { arch: i686, profile: x86 }
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@v10
with:
root-reserve-mb: 8192
temp-reserve-mb: 32
swap-size-mb: 32
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
- name: checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: build binary and appimage
uses: addnab/docker-run-action@v3
with:
image: wyzdwdz/assfonts-amd64:latest
options: -v ${{ github.workspace }}:/var/www
shell: bash
run: |
source ~/.bashrc
cd /var/www
cp ./.github/linux/CMakeUserPresets.json .
cmake . --preset linux-${{ matrix.profile }}
cmake --build . --target install --preset linux-${{ matrix.profile }}-release -j
mv ./out/install/linux-${{ matrix.profile }}/bin/assfonts assfonts-${{ github.ref_name }}-${{ matrix.arch }}-Linux
cp ./.github/linux/AppImageBuilder_${{ matrix.profile }}.yml AppImageBuilder.yml
mkdir -p ./AppDir/usr
cp -r ./out/install/linux-${{ matrix.profile }}/* ./AppDir/usr
mkdir -p ./AppDir/usr/share/icons
cp ./src/qt/resources/icon.png ./AppDir/usr/share/icons
mkdir -p ./AppDir/usr/share/applications
cp ./src/qt/resources/assfonts-gui.desktop ./AppDir/usr/share/applications
sed -i 's/!!!VERSION!!!/${{ github.ref_name }}/g' AppImageBuilder.yml
appimage-builder --recipe AppImageBuilder.yml --skip-tests
- name: upload Linux
uses: actions/upload-artifact@v4
with:
name: release-Linux-${{ matrix.arch }}
path: assfonts*-${{ github.ref_name }}-${{ matrix.arch }}-Linux*
if-no-files-found: error
- name: upload issue
if: failure()
uses: actions/upload-artifact@v4
with:
name: linux-${{ matrix.profile }}-issue
path: out/build/linux-${{ matrix.profile }}/vcpkg_installed/vcpkg/issue_body.md
- name: upload error
if: failure()
uses: actions/upload-artifact@v4
with:
name: linux-${{ matrix.profile }}-error
path: vcpkg/buildtrees/detect_compiler/config-x86-linux-release-rel-err.log
build-windows:
runs-on: windows-2022
defaults:
run:
shell: powershell
strategy:
matrix:
include:
- { arch: x86_64, profile: x64 }
- { arch: aarch64, profile: arm64 }
- { arch: i686, profile: x86 }
steps:
- name: checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: install cmake
uses: lukka/get-cmake@latest
- name: setup msvc x86_64
uses: TheMrMilchmann/setup-msvc-dev@v3
if: ${{ matrix.arch == 'x86_64' }}
with:
arch: x64
- name: setup msvc aarch64
uses: TheMrMilchmann/setup-msvc-dev@v3
if: ${{ matrix.arch == 'aarch64' }}
with:
arch: amd64_arm64
- name: setup msvc i686
uses: TheMrMilchmann/setup-msvc-dev@v3
if: ${{ matrix.arch == 'i686' }}
with:
arch: amd64_x86
- name: build executable binary
run: |
Copy-Item -Path ".\.github\windows\CMakeUserPresets.json" -Destination "CMakeUserPresets.json" -Force
cmake . --preset windows-${{ matrix.profile }}
cmake --build . --target install --preset windows-${{ matrix.profile }}-release -j
- name: copy and rename
run: |
Copy-Item -Path ".\out\install\windows-${{ matrix.profile }}\bin\assfonts.exe" -Destination "assfonts-${{ github.ref_name }}-${{ matrix.arch }}-Windows.exe" -Force
Copy-Item -Path ".\out\install\windows-${{ matrix.profile }}\bin\assfonts-gui.exe" -Destination "assfonts-gui-${{ github.ref_name }}-${{ matrix.arch }}-Windows.exe" -Force
- name: upload Windows
uses: actions/upload-artifact@v4
with:
name: release-Windows-${{ matrix.arch }}
path: assfonts*-${{ github.ref_name }}-${{ matrix.arch }}-Windows*
if-no-files-found: error
- name: upload issue
if: failure()
uses: actions/upload-artifact@v4
with:
name: windows-${{ matrix.profile }}-issue
path: out/build/windows-${{ matrix.profile }}/vcpkg_installed/vcpkg/issue_body.md
build-macos:
runs-on: macos-latest
defaults:
run:
shell: bash
strategy:
matrix:
include:
- { arch: x86_64, profile: x64 }
- { arch: aarch64, profile: arm64 }
steps:
- name: checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: install cmake
uses: lukka/get-cmake@latest
- name: build executable binary
run: |
brew install automake autoconf-archive libtool
cp .github/macos/CMakeUserPresets.json .
cmake . --preset macos-${{ matrix.profile }}
cmake --build . --preset macos-${{ matrix.profile }}-release --target package -j
- name: rename
run: |
mv -f assfonts.dmg assfonts-${{ github.ref_name }}-${{ matrix.arch }}-macOS.dmg
- name: upload macOS
uses: actions/upload-artifact@v4
with:
name: release-macOS-${{ matrix.arch }}
path: assfonts-${{ github.ref_name }}-${{ matrix.arch }}-macOS.dmg
if-no-files-found: error
- name: upload issue
if: failure()
uses: actions/upload-artifact@v4
with:
name: macos-${{ matrix.profile }}-issue
path: out/build/macos-${{ matrix.profile }}/vcpkg_installed/vcpkg/issue_body.md
release:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
needs: [ build-linux, build-windows, build-macos ]
if: github.event_name == 'release'
steps:
- name: checkout
uses: actions/checkout@v4
- name: download Linux x86_64
uses: actions/download-artifact@v4
with:
name: release-Linux-x86_64
- name: download Linux aarch64
uses: actions/download-artifact@v4
with:
name: release-Linux-aarch64
- name: download Linux armhf
uses: actions/download-artifact@v4
with:
name: release-Linux-armhf
- name: download Linux i686
uses: actions/download-artifact@v4
with:
name: release-Linux-i686
- name: download Windows x86_64
uses: actions/download-artifact@v4
with:
name: release-Windows-x86_64
- name: download Windows aarch64
uses: actions/download-artifact@v4
with:
name: release-Windows-aarch64
- name: download Windows i686
uses: actions/download-artifact@v4
with:
name: release-Windows-i686
- name: download macOS x86_64
uses: actions/download-artifact@v4
with:
name: release-macOS-x86_64
- name: download macOS aarch64
uses: actions/download-artifact@v4
with:
name: release-macOS-aarch64
- name: create zips
run: |
sudo apt-get install -y zip
mkdir -p ./share/doc/assfonts
cp LICENSE LICENSE.txt
cp NEWS NEWS.txt
cp NOTICE NOTICE.txt
cp LICENSE NEWS NOTICE ./share/doc/assfonts/
mkdir -p ./share/man/man1
gzip -k ./doc/man/assfonts.1
cp ./doc/man/assfonts.1.gz ./share/man/man1/
mkdir bin
cp -f assfonts-${{ github.ref_name }}-x86_64-Linux ./bin/assfonts
cp -f assfonts-gui-${{ github.ref_name }}-x86_64-Linux.AppImage assfonts-gui.AppImage
tar -czvf assfonts-${{ github.ref_name }}-x86_64-Linux.tar.gz bin/assfonts assfonts-gui.AppImage ./share/doc/assfonts/LICENSE ./share/doc/assfonts/NEWS ./share/doc/assfonts/NOTICE ./share/man/man1/assfonts.1.gz
rm -rf assfonts-${{ github.ref_name }}-x86_64-Linux assfonts-gui-${{ github.ref_name }}-x86_64-Linux.AppImage
cp -f assfonts-${{ github.ref_name }}-aarch64-Linux ./bin/assfonts
cp -f assfonts-gui-${{ github.ref_name }}-aarch64-Linux.AppImage assfonts-gui.AppImage
tar -czvf assfonts-${{ github.ref_name }}-aarch64-Linux.tar.gz bin/assfonts assfonts-gui.AppImage ./share/doc/assfonts/LICENSE ./share/doc/assfonts/NEWS ./share/doc/assfonts/NOTICE ./share/man/man1/assfonts.1.gz
rm -rf assfonts-${{ github.ref_name }}-aarch64-Linux assfonts-gui-${{ github.ref_name }}-aarch64-Linux.AppImage
cp -f assfonts-${{ github.ref_name }}-armhf-Linux ./bin/assfonts
cp -f assfonts-gui-${{ github.ref_name }}-armhf-Linux.AppImage assfonts-gui.AppImage
tar -czvf assfonts-${{ github.ref_name }}-armhf-Linux.tar.gz bin/assfonts assfonts-gui.AppImage ./share/doc/assfonts/LICENSE ./share/doc/assfonts/NEWS ./share/doc/assfonts/NOTICE ./share/man/man1/assfonts.1.gz
rm -rf assfonts-${{ github.ref_name }}-armhf-Linux assfonts-gui-${{ github.ref_name }}-armhf-Linux.AppImage
cp -f assfonts-${{ github.ref_name }}-i686-Linux ./bin/assfonts
cp -f assfonts-gui-${{ github.ref_name }}-i686-Linux.AppImage assfonts-gui.AppImage
tar -czvf assfonts-${{ github.ref_name }}-i686-Linux.tar.gz bin/assfonts assfonts-gui.AppImage ./share/doc/assfonts/LICENSE ./share/doc/assfonts/NEWS ./share/doc/assfonts/NOTICE ./share/man/man1/assfonts.1.gz
rm -rf assfonts-${{ github.ref_name }}-i686-Linux assfonts-gui-${{ github.ref_name }}-i686-Linux.AppImage
cp -f assfonts-${{ github.ref_name }}-x86_64-Windows.exe assfonts.exe
cp -f assfonts-gui-${{ github.ref_name }}-x86_64-Windows.exe assfonts-gui.exe
zip assfonts-${{ github.ref_name }}-x86_64-Windows.zip assfonts.exe assfonts-gui.exe LICENSE.txt NEWS.txt NOTICE.txt README.md
rm -rf assfonts-${{ github.ref_name }}-x86_64-Windows.exe assfonts-gui-${{ github.ref_name }}-x86_64-Windows.exe
cp -f assfonts-${{ github.ref_name }}-aarch64-Windows.exe assfonts.exe
cp -f assfonts-gui-${{ github.ref_name }}-aarch64-Windows.exe assfonts-gui.exe
zip assfonts-${{ github.ref_name }}-aarch64-Windows.zip assfonts.exe assfonts-gui.exe LICENSE.txt NEWS.txt NOTICE.txt README.md
rm -rf assfonts-${{ github.ref_name }}-aarch64-Windows.exe assfonts-gui-${{ github.ref_name }}-aarch64-Windows.exe
cp -f assfonts-${{ github.ref_name }}-i686-Windows.exe assfonts.exe
cp -f assfonts-gui-${{ github.ref_name }}-i686-Windows.exe assfonts-gui.exe
zip assfonts-${{ github.ref_name }}-i686-Windows.zip assfonts.exe assfonts-gui.exe LICENSE.txt NEWS.txt NOTICE.txt README.md
rm -rf assfonts-${{ github.ref_name }}-i686-Windows.exe assfonts-gui-${{ github.ref_name }}-i686-Windows.exe
- name: calculate hash
run: |
sha256sum assfonts-${{ github.ref_name }}-x86_64-Linux.tar.gz > assfonts-${{ github.ref_name }}-x86_64-Linux.tar.gz.sha256sum
sha256sum assfonts-${{ github.ref_name }}-aarch64-Linux.tar.gz > assfonts-${{ github.ref_name }}-aarch64-Linux.tar.gz.sha256sum
sha256sum assfonts-${{ github.ref_name }}-armhf-Linux.tar.gz > assfonts-${{ github.ref_name }}-armhf-Linux.tar.gz.sha256sum
sha256sum assfonts-${{ github.ref_name }}-i686-Linux.tar.gz > assfonts-${{ github.ref_name }}-i686-Linux.tar.gz.sha256sum
sha256sum assfonts-${{ github.ref_name }}-x86_64-Windows.zip > assfonts-${{ github.ref_name }}-x86_64-Windows.zip.sha256sum
sha256sum assfonts-${{ github.ref_name }}-aarch64-Windows.zip > assfonts-${{ github.ref_name }}-aarch64-Windows.zip.sha256sum
sha256sum assfonts-${{ github.ref_name }}-i686-Windows.zip > assfonts-${{ github.ref_name }}-i686-Windows.zip.sha256sum
sha256sum assfonts-${{ github.ref_name }}-x86_64-macOS.dmg > assfonts-${{ github.ref_name }}-x86_64-macOS.dmg.sha256sum
sha256sum assfonts-${{ github.ref_name }}-aarch64-macOS.dmg > assfonts-${{ github.ref_name }}-aarch64-macOS.dmg.sha256sum
- name: edit release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: assfonts-*${{ github.ref_name }}-*
tag: ${{ github.ref }}
overwrite: false
file_glob: true