Skip to content

Bump actions/upload-artifact from 3 to 4 #339

Bump actions/upload-artifact from 3 to 4

Bump actions/upload-artifact from 3 to 4 #339

Workflow file for this run

name: Build Python Packages
on:
workflow_dispatch:
workflow_run:
workflows: ["HELICS Version Update"]
branches: [main]
types:
- completed
release:
types: published
push:
# Run this for a push only if one of the Python packages has changes
paths:
- '*-pip/**'
- '.github/workflows/pythonpackage.yml'
# NOTE: These jobs *must* use actions/checkout@v1 for full history,
# or run git fetch --prune --unshallow for versioning to work
jobs:
build-helics_apps:
# No container needed, since the package is version agnostic
runs-on: ${{ matrix.os }}
strategy:
matrix:
id: [linux, macos, win32, win64]
include:
- id: linux
os: ubuntu-latest
- id: macos
os: macos-latest
plat_name: macosx_10_9_intel
- id: win32
os: windows-latest
arch: win32
plat_name: win32
- id: win64
os: windows-latest
arch: win64
plat_name: win_amd64
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- uses: actions/setup-python@v4
with:
python-version: '3.x'
architecture: 'x64'
- name: Create wheel
shell: bash
run: |
source ./helics_apps-pip/packaging_scripts/setup-${{ runner.os }}.sh "$(cat HELICS_VERSION)" "${{ matrix.arch }}"
./helics_apps-pip/packaging_scripts/build-${{ runner.os }}.sh "${{ matrix.plat_name }}"
./helics_apps-pip/packaging_scripts/repair-${{ runner.os }}.sh
- uses: actions/upload-artifact@v4
with:
name: apps-python-dist
path: upload-wheelhouse
build-helics_apps-sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install -U pip install wheel setuptools cffi
- name: Build sdist
run: |
cd ./helics_apps-pip
python setup.py sdist
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: apps-python-dist
path: helics_apps-pip/dist/*.tar.gz
publish-helics_apps:
needs: [build-helics_apps, build-helics_apps-sdist]
runs-on: ubuntu-latest
if: github.event.action == 'published' || endsWith(github.ref, 'main')
steps:
- name: Get the built packages
uses: actions/download-artifact@v3
with:
name: apps-python-dist
path: dist
- name: Publish package to TestPyPI
if: endsWith(github.ref, 'main')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.test_pypi_helics_apps_password }}
repository_url: https://test.pypi.org/legacy/
- name: Publish package to PyPI
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_helics_apps_password }}