Skip to content

Merge branch 'master' into autosavefeature #1

Merge branch 'master' into autosavefeature

Merge branch 'master' into autosavefeature #1

Workflow file for this run

name: Windows ARM Build
# Many thanks to Cristian Adam for examples
# e.g. https://github.com/cristianadam/HelloWorld/blob/master/.github/workflows/build_cmake.yml
# https://cristianadam.eu/20191222/using-github-actions-with-c-plus-plus-and-cmake/
# This workflow will build and (optionally) sign releases for Windows
# .. since SignPath requires only a Windows build in the action
# .. to successfully sign
on: [push, pull_request, workflow_dispatch]
env:
QT_VERSION: 6.10.0
# this is different from MACOSX_DEPLOYMENT_TARGET to prevent build problems
# we set MACOSX_DEPLOYMENT_TARGET later
FEATURES: -DBUILD_GPL_PLUGINS=ON -DWITH_COORDGEN=OFF -DQT_VERSION=6 -DUSE_3DCONNEXION=OFF -DBUILD_MOLEQUEUE=OFF
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows Qt6 ARM", artifact: "Win-ARM.exe",
os: windows-11-arm,
cc: "cl", cxx: "cl",
build_type: "Release",
cmake_flags: "-DCMAKE_TOOLCHAIN_FILE=/c/vcpkg/scripts/buildsystems/vcpkg.cmake -DUSE_SYSTEM_EIGEN=ON -DUSE_SYSTEM_LIBARCHIVE=ON -DUSE_SYSTEM_LIBXML2=ON -DUSE_SYSTEM_ZLIB=ON",
build_flags: "-j 2",
}
steps:
- name: Checkout workflow repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Checkout Repositories
uses: ./.github/actions/checkout-repositories
- name: Install Qt
uses: jurplel/install-qt-action@d325aaf2a8baeeda41ad0b5d39f84a6af9bcf005 # v4.3.0
with:
cache: true
version: ${{ env.QT_VERSION }}
- name: Configure MSVC Command Prompt
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
arch: arm64
- name: Install Dependencies (Windows)
if: runner.os == 'Windows'
run: |
choco install nsis
cd /c/vcpkg
git pull origin master
vcpkg install libarchive eigen3 libxml2 zlib
shell: bash
- name: Configure
run: |
if [ ! -d "${{ runner.workspace }}/build" ]; then mkdir "${{ runner.workspace }}/build"; fi
cd "${{ runner.workspace }}/build"
CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake $GITHUB_WORKSPACE/openchemistry ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}}
shell: bash
- name: Build
run: |
CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake --build . --config ${{matrix.config.build_type}} ${{matrix.config.build_flags}}
shell: bash
working-directory: ${{ runner.workspace }}/build
- name: Create Windows Packages
if: runner.os == 'Windows'
shell: bash
run: |
gh release download -R prefix-dev/pixi -p "pixi-aarch64-pc-windows-msvc.exe"
# wget https://github.com/prefix-dev/pixi/releases/latest/download/pixi-aarch64-pc-windows-msvc.exe
# move pixi to prefix/bin
mv pixi-aarch64-pc-windows-msvc.exe prefix/bin/pixi.exe
# run windeployqt
windeployqt --release prefix/bin/avogadro2.exe
mv prefix avogadro2
# 7z a Avogadro2-windows.zip avogadro2
cd avogadro2
# create NSIS
/c/Program\ Files\ \(x86\)/NSIS/bin/makensis avogadro2.nsi
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
# This is a tag - extract version
VERSION="${GITHUB_REF#refs/tags/}"
VERSION="${VERSION#v}" # Remove 'v' prefix if present
else
# This is a nightly build - use current date
VERSION=$(date +%Y-%m-%d)
fi
mv Avogadro2-Setup.exe ../Avogadro2-${VERSION}.exe
working-directory: ${{ runner.workspace }}/build/
env:
GH_TOKEN: ${{ github.token }}
- name: Upload
if: matrix.config.artifact != 0
id: upload-artifact
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
path: ${{ runner.workspace }}/build/Avogadro2*.*
name: ${{ matrix.config.artifact }}
- name: Sign Windows release
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
uses: signpath/github-action-submit-signing-request@3f9250c56651ff692d6729a2fbb0603a42d7d322 # v2.0
continue-on-error: true
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: '${{ secrets.SIGNPATH_ORG_ID }}'
project-slug: 'avogadrolibs'
signing-policy-slug: 'release-signing'
github-artifact-id: '${{ steps.upload-artifact.outputs.artifact-id }}'
wait-for-completion: false
output-artifact-directory: '../build/'
- name: Create MSIX
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
shell: powershell
run:
# create MSIX
makeappx pack /v /d . /p ../Avogadro2.msix
working-directory: ${{ runner.workspace }}/build/avogadro2
env:
GH_TOKEN: ${{ github.token }}
- name: Upload MSIX
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
path: ${{ runner.workspace }}/build/Avogadro2.msix
name: Avogadro2.msix
- name: Setup tmate session
if: failure()
uses: mxschmitt/action-tmate@c0afd6f790e3a5564914980036ebf83216678101 # v3.23
timeout-minutes: 60