Skip to content

Commit 4550444

Browse files
committed
chore: github fucking sucks
Signed-off-by: Brian Harring <ferringb@gmail.com>
1 parent a32f22d commit 4550444

3 files changed

Lines changed: 55 additions & 52 deletions

File tree

.github/workflows/_publish.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 54 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,58 @@ jobs:
8282
if-no-files-found: error
8383

8484
publish:
85-
if: github.ref_type == 'tag' || ( github.ref_type == 'branch' || github.ref_name == 'release-test-pypi' )
85+
if: github.ref_type == 'tag'
8686
needs: [build]
87-
uses: ./.github/workflows/_publish.yml
88-
with:
89-
is_test: ${{ github.ref_type == 'tag' }}
90-
release-artifact-ids: ${{ needs.build.outputs.release-artifact-id }},${{ needs.build.outputs.wheel-artifact-id }}
87+
environment: release
88+
permissions:
89+
id-token: write # Used to authenticate to PyPI via OIDC
90+
contents: read
91+
runs-on: ubuntu-latest
92+
93+
steps:
94+
- name: Download artifacts
95+
uses: actions/download-artifact@v5
96+
with:
97+
merge-multiple: true # store both in the root, not in named directories
98+
artifact-ids: ${{ needs.build.outputs.release-artifact-id }},${{ needs.build.outputs.wheel-artifact-id }}
99+
100+
- name: debug
101+
run: find .
102+
103+
- name: Publish github source
104+
uses: softprops/action-gh-release@v2
105+
with:
106+
files: '*.tar.*'
107+
fail_on_unmatched_files: true
108+
draft: true
109+
110+
- name: Publish to PyPi server
111+
uses: pypa/gh-action-pypi-publish@release/v1.13
112+
with:
113+
packages-dir: .
114+
115+
test-publish:
116+
# use the full form to ensure insane tags and errors in 'on' filter still don't kick.
117+
if: github.ref == 'refs/heads/release-test-pypi'
118+
needs: [build]
119+
environment: test-release
120+
permissions:
121+
id-token: write # Used to authenticate to PyPI via OIDC
122+
contents: read
123+
runs-on: ubuntu-latest
124+
125+
steps:
126+
- name: Download artifacts
127+
uses: actions/download-artifact@v5
128+
with:
129+
merge-multiple: true
130+
artifact-ids: ${{ needs.build.outputs.wheel-artifact-id }}
131+
132+
- name: debug
133+
run: find .
134+
135+
- name: Publish to Test PyPi server
136+
uses: pypa/gh-action-pypi-publish@release/v1.13
137+
with:
138+
packages-dir: .
139+
repository-url: https://test.pypi.org/legacy/

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: test
22

33
on:
44
push:
5-
branches-ignore: [deploy]
5+
branches-ignore: [deploy, release-test-pypi]
66
pull_request:
77
branches: [master]
88
workflow_call:

0 commit comments

Comments
 (0)