Skip to content

updated release.yaml #48

updated release.yaml

updated release.yaml #48

Workflow file for this run

name: Molecular plus
on:
push:
tags:
- "v*.*.*" # Trigger release on version tags
pull_request:
branches: [ main ]
jobs:
build_windows:
runs-on: windows-latest
outputs:
VERSION: ${{ steps.build.outputs.VERSION }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10.6
uses: actions/setup-python@v3
with:
python-version: 3.10.6
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest cython
- name: Lint with flake8
run: |
flake8 . --count --exit-zero --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Build with Cython
id: build
shell: pwsh
run: |
$version = python pack_molecular.py
Write-Output "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Upload windows zip
uses: actions/upload-artifact@v3
with:
name: molecular-plus_${{ env.VERSION }}_310_win
path: ./molecular-plus_${{ env.VERSION }}_310_win.zip
build_windows41:
runs-on: windows-latest
outputs:
VERSION: ${{ steps.build.outputs.VERSION }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11.7
uses: actions/setup-python@v3
with:
python-version: 3.11.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest cython
- name: Lint with flake8
run: |
flake8 . --count --exit-zero --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Build with Cython
id: build
shell: pwsh
run: |
$version = python pack_molecular.py
Write-Output "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Upload windows zip
uses: actions/upload-artifact@v3
with:
name: molecular-plus_${{ env.VERSION }}_311_win
path: ./molecular-plus_${{ env.VERSION }}_311_win.zip
build_linux:
runs-on: ubuntu-22.04
outputs:
VERSION: ${{ steps.build.outputs.VERSION }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10.12
uses: actions/setup-python@v3
with:
python-version: 3.10.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest cython
- name: Lint with flake8
run: |
flake8 . --count --exit-zero --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Build with Cython
id: build
run: |
version=$(python pack_molecular.py)
echo "VERSION=${version}" >> $GITHUB_ENV
- name: Upload linux zip
uses: actions/upload-artifact@v3
with:
name: molecular-plus_${{ env.VERSION }}_310_linux
path: ./molecular-plus_${{ env.VERSION }}_310_linux.zip
build_linux41:
runs-on: ubuntu-22.04
outputs:
VERSION: ${{ steps.build.outputs.VERSION }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11.7
uses: actions/setup-python@v3
with:
python-version: 3.11.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest cython
- name: Lint with flake8
run: |
flake8 . --count --exit-zero --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Build with Cython
id: build
run: |
version=$(python pack_molecular.py)
echo "VERSION=${version}" >> $GITHUB_ENV
- name: Upload linux zip
uses: actions/upload-artifact@v3
with:
name: molecular-plus_${{ env.VERSION }}_311_linux
path: ./molecular-plus_${{ env.VERSION }}_311_linux.zip
build_macos:
runs-on: macos-13
outputs:
VERSION: ${{ steps.build.outputs.VERSION }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10.12
uses: actions/setup-python@v3
with:
python-version: 3.10.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest cython
- name: Lint with flake8
run: |
flake8 . --count --exit-zero --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Build with Cython
id: build
run: |
version=$(python pack_molecular.py)
echo "VERSION=${version}" >> $GITHUB_ENV
- name: Upload mac zip
uses: actions/upload-artifact@v3
with:
name: molecular-plus_${{ env.VERSION }}_310_macos
path: ./molecular-plus_${{ env.VERSION }}_310_macos.zip
build_macos41:
runs-on: macos-13
outputs:
VERSION: ${{ steps.build.outputs.VERSION }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11.7
uses: actions/setup-python@v3
with:
python-version: 3.11.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest cython
- name: Lint with flake8
run: |
flake8 . --count --exit-zero --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Build with Cython
id: build
run: |
version=$(python pack_molecular.py)
echo "VERSION=${version}" >> $GITHUB_ENV
- name: Upload mac zip
uses: actions/upload-artifact@v3
with:
name: molecular-plus_${{ env.VERSION }}_311-macos
path: ./molecular-plus_${{ env.VERSION }}_311_macos.zip
release:
runs-on: ubuntu-latest
needs:
- build_windows
- build_windows41
- build_linux
- build_linux41
- build_macos
- build_macos41
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download artifacts
run: |
gh release create ${{ github.ref }} \
--title "${{ github.event.repository.name }} Release ${{ github.ref }}" \
--notes "Release notes for ${{ github.ref }}" \
molecular-plus_${{ needs.build_windows.outputs.VERSION }}_310_win.zip \
molecular-plus_${{ needs.build_windows41.outputs.VERSION }}_311_win.zip \
molecular-plus_${{ needs.build_linux.outputs.VERSION }}_310_linux.zip \
molecular-plus_${{ needs.build_linux41.outputs.VERSION }}_311_linux.zip \
molecular-plus_${{ needs.build_macos.outputs.VERSION }}_310_macos.zip \
molecular-plus_${{ needs.build_macos41.outputs.VERSION }}_311_macos.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}