Fix only wheels for release artifacts. #26
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
name: windows | |
on: | |
push: | |
branches: [ "main", "dev" ] | |
pull_request: | |
branches: [ "main", "dev" ] | |
release: | |
types: [published] | |
jobs: | |
windows: | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- name: MSYS2, Gfortran, fpm | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: MINGW64 | |
install: >- | |
mingw-w64-x86_64-gcc-fortran | |
mingw-w64-x86_64-fpm | |
git | |
make | |
zip | |
- name: Gfortran version | |
run : gfortran --version | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Configure | |
run: | | |
. ./configure.sh | |
echo "NAME=$NAME" >> $GITHUB_ENV | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
echo "PLATFORM=$PLATFORM" >> $GITHUB_ENV | |
echo "ARCH=$ARCH" >> $GITHUB_ENV | |
- name: Compile | |
run: | | |
chmod u+x build.sh | |
./build.sh | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Python wheel | |
run: | | |
py -0 | |
py -m pip install -U --user setuptools build wheel | |
cd py | |
py -m build -n --wheel | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.NAME }}-${{ env.PLATFORM }}-${{ env.ARCH }}-${{ env.VERSION }} | |
path: ./build/install/ | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: py${{ env.NAME }}-${{ env.PLATFORM }}-${{ env.ARCH }}-${{ env.VERSION }} | |
path: ./py/dist/ | |
- name: Release libs | |
if: ${{ github.event_name == 'release' }} | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ./build/*.zip | |
file_glob: true | |
tag: ${{ github.ref }} | |
overwrite: true | |
- name: Release pywrapper | |
if: ${{ github.event_name == 'release' }} | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ./py/dist/*.whl | |
file_glob: true | |
tag: ${{ github.ref }} | |
overwrite: true |