Skip to content

Commit 9fa108d

Browse files
authored
Update build.yml
Add GitHub Action to build releases and release candidates and push the artifacts to pypi.
1 parent 28c06e3 commit 9fa108d

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Build packages
22

3-
on:
3+
on:
44
push:
55
branches:
66
- master
@@ -39,7 +39,8 @@ jobs:
3939
if: contains(github.ref, 'refs/heads/integration/')
4040
run: |
4141
echo ${{ steps.extract_version.outputs.raw_version }}
42-
rc_version=${{ steps.extract_version.outputs.raw_version }}rc0
42+
rc_version=${{ steps.extract_version.outputs.raw_version }}rc1
43+
sed -i -e "s/__version__ = \"${{ steps.extract_version.outputs.raw_version }}/__version__ = \"$rc_version/g" sarpy/__about__.py
4344
echo "version=$rc_version" >> $GITHUB_OUTPUT
4445
id: extract_release_candidate_version
4546
- name: Install pypa/build
@@ -94,3 +95,24 @@ jobs:
9495
prerelease: false
9596
target_commitish: ${{github.ref}}
9697
files: dist/*
98+
99+
publish-to-pypi:
100+
name: Publish to PyPI
101+
needs: release
102+
runs-on: ubuntu-latest
103+
environment:
104+
name: development
105+
permissions:
106+
id-token: write
107+
steps:
108+
- name: Download all the dists
109+
uses: actions/download-artifact@v4
110+
with:
111+
name: ${{ needs.build.outputs.version }}
112+
path: dist
113+
merge-multiple: true
114+
- run: ls -R dist
115+
- name: Publish distribution to PyPI
116+
uses: pypa/gh-action-pypi-publish@release/v1
117+
with:
118+
repository-url: https://pypi.org/legacy/

0 commit comments

Comments
 (0)