-
Notifications
You must be signed in to change notification settings - Fork 679
44 lines (40 loc) · 1.43 KB
/
flax_publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Flax - Build and upload to PyPI
on:
release:
types: [published]
jobs:
build_package:
name: Build package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Build package
run: pipx run build
- name: List files
run: ls -l dist/
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: distribution
path: |
dist/*.tar.gz
dist/*.whl
upload_pypi:
name: Release & Upload to PyPI
# Only publish release to PyPI when a github release is created.
if: github.event_name == 'release' && github.event.action == 'published'
needs: build_package
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: distribution
path: dist
- name: List files
run: ls -l dist/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4