Skip to content

Commit

Permalink
some improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsm authored Nov 30, 2024
1 parent 33dab31 commit c50525f
Showing 1 changed file with 43 additions and 17 deletions.
60 changes: 43 additions & 17 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,53 @@ name: windows
on:
push:
branches: [ "develop", "release/*" ]
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
pull_request:
branches: [ "develop", "release/*" ]
workflow_dispatch:

env:
BUILD_TYPE: Release

jobs:
setup:
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
VERSION=${{ github.ref_name }}
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
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-windows:
runs-on: windows-latest
needs: setup
strategy:
fail-fast: false
steps:
Expand Down Expand Up @@ -40,13 +77,9 @@ jobs:
build-windows-msys2:
runs-on: windows-latest
needs: setup
strategy:
fail-fast: false
matrix:
sys:
- mingw64
- clang64
- ucrt64
defaults:
run:
shell: msys2 {0}
Expand All @@ -63,21 +96,14 @@ jobs:
- name: Set up MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
msystem: ucrt64
cache: true
update: true
install: >-
bison
flex
dos2unix
pacboy: >-
cmake:p
gcc:p
make:p
gperf:p
install: bison flex dos2unix zip p7zip
pacboy: cmake:p gcc:p make:p ninja:p gperf:p

- name: Build with cmake
run: |
cmake.exe -B build/ -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake.exe --build build/ -j`nproc` --config ${{env.BUILD_TYPE}}
cmake.exe -B build/ -G "Ninja" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake.exe --build build/ --parallel --config ${{env.BUILD_TYPE}}

0 comments on commit c50525f

Please sign in to comment.