Skip to content

Commit

Permalink
feat: improve nightly and other workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
saturneric committed Nov 22, 2024
1 parent 2bd2f47 commit cf3a595
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 81 deletions.
31 changes: 15 additions & 16 deletions .github/workflows/release-qt5.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Build & Package Qt5
name: Build Release (Qt5)

on:
push:
branches: [ main, 'develop', 'dev/**' ]
branches: [main]
paths-ignore:
- 'resource/lfs/locale/**'
- '**.md'
- "resource/lfs/locale/**"
- "**.md"
pull_request:
branches: [ main, 'develop', 'dev/**' ]
branches: [main]
paths-ignore:
- 'resource/lfs/locale/**'
- '**.md'
- "resource/lfs/locale/**"
- "**.md"

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
Expand All @@ -20,7 +20,7 @@ jobs:
build:
strategy:
matrix:
os: [ 'ubuntu-20.04', 'windows-2019' ]
os: ["ubuntu-20.04", "windows-2019"]
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
Expand All @@ -32,7 +32,7 @@ jobs:

- uses: actions/checkout@v4
with:
lfs: 'false'
lfs: "false"
submodules: recursive

- name: Get Short SHA of Commit
Expand Down Expand Up @@ -67,12 +67,12 @@ jobs:
sudo apt-get -y install libglu1-mesa-dev libfontconfig1-dev libx11-xcb-dev libxcb-image0
sudo apt-get -y install libglu1-mesa-dev libfontconfig1-dev libx11-xcb-dev libxcb-* libxkbcommon-x11-0
if: matrix.os == 'ubuntu-20.04'

- name: Install Qt5
uses: jurplel/install-qt-action@v3
with:
version: '5.15.2'
cache: 'true'
version: "5.15.2"
cache: "true"
if: matrix.os == 'ubuntu-20.04'

- name: Build gpg-error (Windows)
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
make install
cd ${{github.workspace}}
if: matrix.os == 'windows-2019'

- name: Build assuan (Linux)
run: |
git clone --depth 1 --branch libassuan-2.5.6 git://git.gnupg.org/libassuan.git ${{github.workspace}}/third_party/libassuan
Expand All @@ -127,7 +127,7 @@ jobs:
make install
cd ${{github.workspace}}
if: matrix.os == 'windows-2019'

- name: Build GpgME (Linux)
run: |
git clone --depth 1 --branch gpgme-1.22.0 git://git.gnupg.org/gpgme.git ${{github.workspace}}/third_party/gpgme
Expand Down Expand Up @@ -175,7 +175,6 @@ jobs:
echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> ${GITHUB_ENV}
if: matrix.os == 'ubuntu-20.04'


- name: Copy Modules & Package (Windows)
shell: msys2 {0}
run: |
Expand All @@ -185,7 +184,7 @@ jobs:
echo "BUILD_TYPE_LOWER=${BUILD_TYPE,,}" >> ${GITHUB_ENV}
echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> ${GITHUB_ENV}
if: matrix.os == 'windows-2019'

- name: Upload Artifact(Linux)
uses: actions/upload-artifact@v4
with:
Expand Down
42 changes: 21 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Build & Package
name: Build Release

on:
push:
branches: [ main, 'develop', 'dev/**' ]
branches: [main]
paths-ignore:
- 'resource/lfs/locale/**'
- '**.md'
- "resource/lfs/locale/**"
- "**.md"
pull_request:
branches: [ main, 'develop', 'dev/**' ]
branches: [main]
paths-ignore:
- 'resource/lfs/locale/**'
- '**.md'
- "resource/lfs/locale/**"
- "**.md"

env:
# Customize the CMake build type here (Release, Debug, etc.)
Expand All @@ -20,7 +20,7 @@ jobs:
build:
strategy:
matrix:
os: [ 'ubuntu-20.04', 'macos-13', 'macos-12', "macos-14", 'windows-2019' ]
os: ["ubuntu-20.04", "macos-13", "macos-12", "macos-14", "windows-2019"]
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
Expand All @@ -32,7 +32,7 @@ jobs:

- uses: actions/checkout@v4
with:
lfs: 'false'
lfs: "false"
submodules: recursive

- name: Get Short SHA of Commit
Expand Down Expand Up @@ -69,13 +69,13 @@ jobs:
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
if: matrix.os == 'macos-13' || matrix.os == 'macos-12' || matrix.os == 'macos-14'
if: matrix.os == 'macos-13' || matrix.os == 'macos-12' || matrix.os == 'macos-14'

- name: Install Qt6
uses: jurplel/install-qt-action@v3
with:
version: '6.7.2'
cache: 'true'
version: "6.7.2"
cache: "true"
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'macos-13' || matrix.os == 'macos-12' || matrix.os == 'macos-14'

- name: Install Dependence (macOS)
Expand All @@ -84,7 +84,7 @@ jobs:
brew install ninja libarchive gpgme googletest
brew install create-dmg
brew link openssl@3 --force
if: matrix.os == 'macos-13' || matrix.os == 'macos-12' || matrix.os == 'macos-14'
if: matrix.os == 'macos-13' || matrix.os == 'macos-12' || matrix.os == 'macos-14'

- name: Set up MinGW (Windows)
uses: msys2/setup-msys2@v2
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
sudo ninja install
if: matrix.os == 'ubuntu-20.04'

- name: Build & Install Full SDK
- name: Build & Install Full SDK
run: |
cmake -B ${{github.workspace}}/build-full-sdk -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGPGFRONTEND_BUILD_TYPE_FULL_SDK=ON
cmake --build ${{github.workspace}}/build-full-sdk --config {{$env.BUILD_TYPE}} -- -v
Expand Down Expand Up @@ -228,15 +228,15 @@ jobs:
xcodebuild -exportArchive -archivePath ${{github.workspace}}/build/GpgFrontend.xcarchive \
-exportOptionsPlist ${{github.workspace}}/build/ExportOptions.plist \
-exportPath ${{github.workspace}}/build/package/
if: matrix.os == 'macos-13' || matrix.os == 'macos-12' || matrix.os == 'macos-14'
if: matrix.os == 'macos-13' || matrix.os == 'macos-12' || matrix.os == 'macos-14'

- name: Copy Modules into Bundle & Deploy Qt & Code Sign (macOS)
run: |
codesign -s "${{secrets.GPGFRONTEND_XOCDE_CODE_SIGN_IDENTITY}}" -f --deep --options=runtime --timestamp ${{github.workspace}}/modules/build/artifacts/modules/*
cmake -E copy_directory ${{github.workspace}}/modules/build/artifacts/modules ${{github.workspace}}/build/package/GpgFrontend.app/Contents/Modules
macdeployqt ${{github.workspace}}/build/package/GpgFrontend.app -verbose=2 -appstore-compliant -always-overwrite
codesign -s "${{secrets.GPGFRONTEND_XOCDE_CODE_SIGN_IDENTITY}}" -f --deep --options=runtime --timestamp ${{github.workspace}}/build/package/GpgFrontend.app
if: matrix.os == 'macos-13' || matrix.os == 'macos-12' || matrix.os == 'macos-14'
if: matrix.os == 'macos-13' || matrix.os == 'macos-12' || matrix.os == 'macos-14'

- name: Package & Sign App Bundle (macOS)
run: |
Expand All @@ -250,7 +250,7 @@ jobs:
${{github.workspace}}/build/final-artifact/GpgFrontend-${{env.sha_short}}-x86_64.dmg
mv ${{github.workspace}}/build/GpgFrontend.app.zip \
${{github.workspace}}/build/GpgFrontend-${{env.sha_short}}-x86_64.zip
if: matrix.os == 'macos-13' || matrix.os == 'macos-12' || matrix.os == 'macos-14'
if: matrix.os == 'macos-13' || matrix.os == 'macos-12' || matrix.os == 'macos-14'

- name: Notarize Release Build (macOS)
run: |
Expand All @@ -261,8 +261,8 @@ jobs:
${{github.workspace}}/build/GpgFrontend-${{env.sha_short}}-x86_64.zip
echo "BUILD_TYPE_LOWER=$(echo ${BUILD_TYPE} | tr '[:upper:]' '[:lower:]')" >> ${GITHUB_ENV}
echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> ${GITHUB_ENV}
if: matrix.os == 'macos-13' || matrix.os == 'macos-12' || matrix.os == 'macos-14'
if: matrix.os == 'macos-13' || matrix.os == 'macos-12' || matrix.os == 'macos-14'

- name: Build GpgFrontend (Linux)
# Build your GpgFrontend with the given configuration
run: |
Expand Down Expand Up @@ -291,7 +291,7 @@ jobs:
cmake -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGPGFRONTEND_BUILD_TYPE_ONLY_APPLICATION=ON ..
cmake --build . --config ${{env.BUILD_TYPE}} -- -j 4
if: matrix.os == 'windows-2019'

- name: Copy Modules & Package (Windows)
shell: msys2 {0}
run: |
Expand All @@ -316,7 +316,7 @@ jobs:
with:
name: gpgfrontend-${{matrix.os}}-${{env.BUILD_TYPE_LOWER}}-${{env.SHORT_SHA}}
path: ${{github.workspace}}/build/final-artifact/*
if: matrix.os == 'macos-13' || matrix.os == 'macos-12' || matrix.os == 'macos-14'
if: matrix.os == 'macos-13' || matrix.os == 'macos-12' || matrix.os == 'macos-14'

- name: Upload Artifact (Windows)
uses: actions/upload-artifact@master
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build & Package & Release Nightly
name: Build Nightly

on:
push:
Expand Down Expand Up @@ -83,18 +83,32 @@ jobs:
- name: Set up MinGW (Windows)
uses: msys2/setup-msys2@v2
with:
install: git msys2-devel base-devel binutils mingw-w64-x86_64-toolchain
update: true
release: false
if: matrix.os == 'windows-2019'

- name: Set up Dependence (Windows)
shell: msys2 {0}
run: |
pacman --noconfirm -S --needed mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-cmake autoconf
pacman --noconfirm -S --needed make texinfo automake zip
pacman --noconfirm -S --needed mingw-w64-x86_64-qt6 mingw-w64-x86_64-icu libintl msys2-runtime-devel gettext-devel
pacman --noconfirm -S --needed mingw-w64-x86_64-ninja mingw-w64-x86_64-gnupg mingw-w64-x86_64-libarchive
pacman --noconfirm -S --needed mingw-w64-x86_64-gtest
cache: true
install: >-
git
msys2-devel
base-devel
binutils
autoconf
make
texinfo
automake
zip
libintl
gettext-devel
msys2-runtime-devel
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-gcc
mingw-w64-x86_64-make
mingw-w64-x86_64-cmake
mingw-w64-x86_64-qt6
mingw-w64-x86_64-icu
mingw-w64-x86_64-ninja
mingw-w64-x86_64-gnupg
mingw-w64-x86_64-libarchive
mingw-w64-x86_64-gtest
if: matrix.os == 'windows-2019'

- name: Build gpg-error (Linux)
Expand All @@ -107,17 +121,6 @@ jobs:
cd ${{github.workspace}}
if: matrix.os == 'ubuntu-20.04'

- name: Build gpg-error (Windows)
shell: msys2 {0}
run: |
git clone --depth 1 --branch libgpg-error-1.47 git://git.gnupg.org/libgpg-error.git ${{github.workspace}}/third_party/libgpg-error
cd ${{github.workspace}}/third_party/libgpg-error
./autogen.sh
./configure --enable-maintainer-mode && make -j4
make install
cd ${{github.workspace}}
if: matrix.os == 'windows-2019'

- name: Build assuan (Linux)
run: |
git clone --depth 1 --branch libassuan-2.5.6 git://git.gnupg.org/libassuan.git ${{github.workspace}}/third_party/libassuan
Expand All @@ -128,17 +131,6 @@ jobs:
cd ${{github.workspace}}
if: matrix.os == 'ubuntu-20.04'

- name: Build assuan (Windows)
shell: msys2 {0}
run: |
git clone --depth 1 --branch libassuan-2.5.6 git://git.gnupg.org/libassuan.git ${{github.workspace}}/third_party/libassuan
cd ${{github.workspace}}/third_party/libassuan
./autogen.sh
./configure --enable-maintainer-mode && make -j4
make install
cd ${{github.workspace}}
if: matrix.os == 'windows-2019'

- name: Build GpgME (Linux)
run: |
git clone --depth 1 --branch gpgme-1.22.0 git://git.gnupg.org/gpgme.git ${{github.workspace}}/third_party/gpgme
Expand Down Expand Up @@ -179,7 +171,7 @@ jobs:
- name: Build & Install Full SDK (Windows)
shell: msys2 {0}
run: |
cd $(echo "/${{github.workspace}}" | sed 's/\\/\//g' | sed 's/://')
cygpath -u ${{github.workspace}}
mkdir build-full-sdk && cd build-full-sdk
cmake -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGPGFRONTEND_BUILD_TYPE_FULL_SDK=ON -DCMAKE_INSTALL_PREFIX=$MSYSTEM_PREFIX ..
cmake --build . --config ${{env.BUILD_TYPE}} -- -j 4
Expand All @@ -196,7 +188,7 @@ jobs:
- name: Build Integrated Modules (Windows)
shell: msys2 {0}
run: |
cd $(echo "/${{github.workspace}}" | sed 's/\\/\//g' | sed 's/://')
cygpath -u ${{github.workspace}}
cd modules
mkdir build && cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGPGFRONTEND_BUILD_TYPE_STABLE=ON -DCMAKE_INSTALL_PREFIX=./artifacts ..
Expand Down Expand Up @@ -279,22 +271,22 @@ jobs:
- name: Configure CMake & Build Application (Windows)
shell: msys2 {0}
run: |
cd $(echo "/${{github.workspace}}" | sed 's/\\/\//g' | sed 's/://')
cygpath -u ${{github.workspace}}
mkdir build && cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGPGFRONTEND_BUILD_TYPE_ONLY_APPLICATION=ON ..
cmake --build . --config ${{env.BUILD_TYPE}} -- -j 4
if: matrix.os == 'windows-2019'

- name: Get short SHA of Git Commit (Windows)
run: echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 8))" >> $env:GITHUB_ENV
- name: Generate Env Vars (Windows)
run: |
echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 8))" >> $env:GITHUB_ENV
echo "BUILD_TYPE_LOWER=$("${{env.BUILD_TYPE}}".ToLower())" >> $env:GITHUB_ENV
if: matrix.os == 'windows-2019'

- name: Copy Modules & Package (Windows)
shell: msys2 {0}
run: |
echo "BUILD_TYPE_LOWER=${BUILD_TYPE,,}" >> ${GITHUB_ENV}
echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> ${GITHUB_ENV}
cd $(echo "/${{github.workspace}}" | sed 's/\\/\//g' | sed 's/://')
cygpath -u ${{github.workspace}}
mkdir -p build/artifacts/modules
cp -r modules/build/artifacts/bin/* build/artifacts/modules
cd build
Expand Down Expand Up @@ -353,7 +345,24 @@ jobs:
draft: false
prerelease: true
body: |
This is a nightly release of the GpgFrontend.
It's unstable compared to the official releases, **use it with caution**!
### Nightly Release of GpgFrontend
This is an **unstable nightly build** of GpgFrontend.
It may contain new features or bug fixes that are under testing.
Please note that this version is less stable compared to official
releases and is intended for testing purposes **only**.
#### Why Nightly Releases?
This nightly release aims to provide users with early access to
features or fixes they urgently need. Given that official releases are
typically published at least two months apart, I understand that the
wait may be too long for some users.
#### Important Notes:
- For **Windows** users: After downloading, overwrite the contents
of `GpgFrontend/Program/bin` in your installation directory with the
files provided in this nightly release.
- Use this version at your own risk; it is not recommended for
production environments.
files: |
artifacts/*

0 comments on commit cf3a595

Please sign in to comment.