Skip to content

Commit

Permalink
Fixed release workflow (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
santacodes authored Aug 22, 2024
1 parent 1ae8dbd commit dbb3bb1
Showing 1 changed file with 39 additions and 34 deletions.
73 changes: 39 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
jobs:
build:
name: Build and pybamm-cookie sdist and wheel
runs-on: ubuntu-latest
steps:
- name: Checkout pybamm-cookie
- uses: actions/checkout@v4
name: Publish to PyPI
on:
release:
types: [published]

- name: Setup Python
uses: actions/setup-python@v5
jobs:
build:
name: Build and pybamm-cookie sdist and wheel
runs-on: ubuntu-latest
steps:
- name: Checkout pybamm-cookie
uses: actions/checkout@v4

- name: Build package
run: pipx run build
- name: Setup Python
uses: actions/setup-python@v5

- name: Upload artifacts
uses: actions/[email protected]
with:
name: sdist_and_wheel
path: ./dist/*
if-no-files-found: error
- name: Build package
run: pipx run build

publish-pypi:
name: Upload package to PyPI
needs: [build]
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
- name: Upload artifacts
uses: actions/[email protected]
with:
name: sdist_and_wheel
path: ./dist/*
if-no-files-found: error

steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
publish-pypi:
name: Upload package to PyPI
needs: [build]
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0
with:
packages-dir: artifacts/
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0
with:
packages-dir: artifacts/

0 comments on commit dbb3bb1

Please sign in to comment.