-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1091 from dsm/current
CI improvements
- Loading branch information
Showing
9 changed files
with
217 additions
and
101 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ on: | |
|
||
env: | ||
APP_NAME: "Qucs-S" | ||
CI_VERSION: 24.4.99 | ||
EXECUTABLE_NAME: "qucs-s" | ||
PUBLISHER_NAME: "The Qucs-S Team" | ||
BUILD_TYPE: Release | ||
|
@@ -25,25 +24,83 @@ jobs: | |
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.read_version.outputs.version }} | ||
short_hash: ${{ steps.read_version.outputs.short_hash }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Read version from file | ||
id: read_version | ||
run: | | ||
if [ "${{github.ref_type}}" == "tag" ]; then | ||
if [ "${{ github.ref_type }}" == "tag" ]; then | ||
VERSION=${{ github.ref_name }} | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
else | ||
VERSION=${{ env.CI_VERSION }} | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
SHORT_HASH="" | ||
else | ||
MAJOR_MINOR=$(cut -d. -f1-2 VERSION) | ||
VERSION="${MAJOR_MINOR}.99" | ||
# Get the short hash of the current commit | ||
COMMIT_HASH=$(echo ${{ github.sha }} | cut -c1-7) | ||
SHORT_HASH="-$COMMIT_HASH" | ||
fi | ||
- name: Print version | ||
run: echo "Qucs-S version is ${{ env.VERSION }}" | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
echo "SHORT_HASH=$SHORT_HASH" >> $GITHUB_ENV | ||
echo "short_hash=$SHORT_HASH" >> $GITHUB_OUTPUT | ||
- name: Print version and hash | ||
run: | | ||
echo "Qucs-S version is ${{ env.VERSION }}" | ||
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}" | ||
build-linux-qt5: | ||
runs-on: ubuntu-22.04 | ||
continue-on-error: true | ||
needs: setup | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set version environment variable | ||
run: | | ||
echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV | ||
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" >> $GITHUB_ENV | ||
- name: Print version and hash | ||
run: | | ||
echo "Qucs-S version is ${{ env.VERSION }}" | ||
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}" | ||
- name: Install Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libglx-dev libgl1-mesa-dev flex bison gperf dos2unix flex bison gperf dos2unix cups libcups2-dev | ||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 --slave /usr/bin/g++ g++ /usr/bin/g++-12 | ||
- name: 'Install Qt5' | ||
uses: jurplel/install-qt-action@v4 | ||
with: | ||
version: 5.15.2 | ||
host: 'linux' | ||
target: 'desktop' | ||
cache: true | ||
arch: 'gcc_64' | ||
install-deps: 'true' | ||
modules: 'qtcharts' | ||
|
||
- name: 'Configure CMake' | ||
run: | | ||
cmake -B ${{github.workspace}}/build \ | ||
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ | ||
-DCI_VERSION="${{env.VERSION}}" | ||
- name: 'Build' | ||
# Build your program with the given configuration | ||
run: | | ||
cmake --build ${{github.workspace}}/build -j`nproc` --config ${{env.BUILD_TYPE}} | ||
build-linux-appimage-qt6: | ||
runs-on: ubuntu-22.04 | ||
|
@@ -54,10 +111,14 @@ jobs: | |
submodules: recursive | ||
|
||
- name: Set version environment variable | ||
run: echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV | ||
run: | | ||
echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV | ||
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" >> $GITHUB_ENV | ||
- name: Print version | ||
run: echo "Qucs-S version is ${{ env.VERSION }}" | ||
- name: Print version and hash | ||
run: | | ||
echo "Qucs-S version is ${{ env.VERSION }}" | ||
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}" | ||
- name: Install Dependencies | ||
run: | | ||
|
@@ -109,13 +170,13 @@ jobs: | |
--plugin=qt --output appimage | ||
rm linuxdeploy-x86_64.AppImage | ||
rm linuxdeploy-plugin-qt-x86_64.AppImage | ||
mv *.AppImage ${{ env.APP_NAME }}-${{env.VERSION}}-linux-x86_64.AppImage | ||
mv *.AppImage ${{ env.APP_NAME }}-${{env.VERSION}}${{env.SHORT_HASH}}-linux-x86_64.AppImage | ||
- name: 'Upload artifact: AppImage' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.APP_NAME }}-${{env.VERSION}}-linux-x86_64 | ||
path: ${{ env.APP_NAME }}-${{env.VERSION}}-linux-x86_64.AppImage | ||
name: ${{ env.APP_NAME }}-${{env.VERSION}}${{env.SHORT_HASH}}-linux-x86_64 | ||
path: ${{ env.APP_NAME }}-${{env.VERSION}}${{env.SHORT_HASH}}-linux-x86_64.AppImage | ||
|
||
|
||
build-mac-intel: | ||
|
@@ -129,10 +190,14 @@ jobs: | |
xcode-version: latest-stable | ||
|
||
- name: Set version environment variable | ||
run: echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV | ||
run: | | ||
echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV | ||
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" >> $GITHUB_ENV | ||
- name: Print version | ||
run: echo "Qucs-S version is ${{ env.VERSION }}" | ||
- name: Print version and hash | ||
run: | | ||
echo "Qucs-S version is ${{ env.VERSION }}" | ||
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}" | ||
- uses: actions/checkout@v4 | ||
with: | ||
|
@@ -221,10 +286,14 @@ jobs: | |
xcode-version: latest-stable | ||
|
||
- name: Set version environment variable | ||
run: echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV | ||
run: | | ||
echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV | ||
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" >> $GITHUB_ENV | ||
- name: Print version | ||
run: echo "Qucs-S version is ${{ env.VERSION }}" | ||
- name: Print version and hash | ||
run: | | ||
echo "Qucs-S version is ${{ env.VERSION }}" | ||
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}" | ||
- uses: actions/checkout@v4 | ||
with: | ||
|
@@ -300,9 +369,69 @@ jobs: | |
with: | ||
name: ${{ env.APP_NAME }}-${{env.VERSION}}-macOS | ||
path: ${{ env.APP_NAME }}-${{env.VERSION}}-macOS.dmg | ||
|
||
build-windows-msvc: | ||
runs-on: windows-latest | ||
needs: setup | ||
strategy: | ||
fail-fast: false | ||
defaults: | ||
run: | ||
shell: pwsh | ||
steps: | ||
- name: Disable autocrlf in Git | ||
run: | | ||
git config --global core.autocrlf false | ||
git config --global core.eol lf | ||
- name: Set version environment variable | ||
run: | | ||
echo "VERSION=${{ needs.setup.outputs.version }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
- name: Print version and hash | ||
run: | | ||
echo "Qucs-S version is ${{ env.VERSION }}" | ||
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}" | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: 'Install Qt6' | ||
uses: jurplel/install-qt-action@v4 | ||
with: | ||
version: ${{env.QT_VERSION}} | ||
host: 'windows' | ||
target: 'desktop' | ||
cache: true | ||
arch: 'win64_msvc2022_64' | ||
install-deps: 'true' | ||
modules: 'qtcharts' | ||
|
||
- name: '⚙️ Install CMake' | ||
uses: lukka/get-cmake@latest | ||
with: | ||
useLocalCache: true | ||
|
||
- name: '🛠 Setup MSVC Development Environment' | ||
uses: TheMrMilchmann/setup-msvc-dev@v3 | ||
with: | ||
arch: x64 | ||
|
||
- name: 'Configure CMake' | ||
run: | | ||
cmake -B ${{github.workspace}}/build -DWITH_QT6=1 ` | ||
-DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl ` | ||
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ` | ||
-DCI_VERSION="${{env.VERSION}}" | ||
- name: 'Build Qucs-s' | ||
run: | | ||
cmake --build ${{github.workspace}}/build -j 16 --config=${{env.BUILD_TYPE}} | ||
build-windows: | ||
runs-on: windows-2022 | ||
continue-on-error: true | ||
needs: setup | ||
strategy: | ||
fail-fast: false | ||
|
@@ -320,10 +449,13 @@ jobs: | |
shell: pwsh | ||
run: | | ||
echo "VERSION=${{ needs.setup.outputs.version }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
- name: Print version | ||
- name: Print version and hash | ||
shell: pwsh | ||
run: echo "Qucs-S version is ${{ env.VERSION }}" | ||
run: | | ||
echo "Qucs-S version is ${{ env.VERSION }}" | ||
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}" | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
@@ -404,26 +536,26 @@ jobs: | |
mkdir -p build/qucs-suite/misc | ||
cp -rf contrib/InnoSetup/misc build/qucs-suite/ | ||
cd build/qucs-suite | ||
zip -r ../../${{ env.APP_NAME }}-${{ env.VERSION }}-win64.zip ./bin ./share ./lib ./misc | ||
zip -r ../../${{ env.APP_NAME }}-${{ env.VERSION }}${{ env.SHORT_HASH }}-win64.zip ./bin ./share ./lib ./misc | ||
cd ../.. | ||
- name: Compile .ISS to .EXE Installer | ||
uses: Minionguyjpro/[email protected].4 | ||
uses: Minionguyjpro/[email protected].5 | ||
with: | ||
path: contrib/InnoSetup/qucs.iss | ||
options: /Qp /O"${{github.workspace}}" /DAPPNAME=${{ env.APP_NAME }} /DRELEASE="${{ env.VERSION }}" | ||
options: /Qp /O"${{github.workspace}}" /DAPPNAME=${{ env.APP_NAME }} /DRELEASE="${{ env.VERSION }}${{ env.SHORT_HASH }}" | ||
|
||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.APP_NAME }}-${{ env.VERSION }}-win64 | ||
path: ${{ env.APP_NAME }}-${{ env.VERSION }}-win64.zip | ||
name: ${{ env.APP_NAME }}-${{ env.VERSION }}${{ env.SHORT_HASH }}-win64 | ||
path: ${{ env.APP_NAME }}-${{ env.VERSION }}${{ env.SHORT_HASH }}-win64.zip | ||
|
||
- name: Upload exe artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.APP_NAME }}-${{ env.VERSION }}-setup | ||
path: ${{ env.APP_NAME }}-${{ env.VERSION }}-setup.exe | ||
name: ${{ env.APP_NAME }}-${{ env.VERSION }}${{ env.SHORT_HASH }}-setup | ||
path: ${{ env.APP_NAME }}-${{ env.VERSION }}${{ env.SHORT_HASH }}-setup.exe | ||
|
||
create-release: | ||
runs-on: ubuntu-latest | ||
|
@@ -434,10 +566,14 @@ jobs: | |
uses: actions/checkout@v4 | ||
|
||
- name: Set version environment variable | ||
run: echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV | ||
run: | | ||
echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV | ||
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" >> $GITHUB_ENV | ||
- name: Print version | ||
run: echo "Qucs-S version is ${{ env.VERSION }}" | ||
- name: Print version and hash | ||
run: | | ||
echo "Qucs-S version is ${{ env.VERSION }}" | ||
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}" | ||
- name: Download build artifacts | ||
uses: actions/download-artifact@v4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.