Skip to content

Commit 2d8b60e

Browse files
authored
Github Actions workflow to attach release artifacts to release (matrix-org#10379)
1 parent ae81ec4 commit 2d8b60e

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

.github/workflows/release-artifacts.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
tags: ["v*"]
1414

1515
permissions:
16-
contents: read
16+
contents: write
1717

1818
jobs:
1919
# first get the list of distros to build for.
@@ -62,3 +62,29 @@ jobs:
6262
with:
6363
name: python-dist
6464
path: dist/*
65+
66+
# if it's a tag, create a release and attach the artifacts to it
67+
attach-assets:
68+
name: "Attach assets to release"
69+
if: startsWith(github.ref, 'refs/tags/')
70+
needs:
71+
- build-debs
72+
- build-sdist
73+
runs-on: ubuntu-latest
74+
steps:
75+
- name: Download all workflow run artifacts
76+
uses: actions/download-artifact@v2
77+
- name: Build a tarball for the debs
78+
run: tar -cvJf debs.tar.xz debs
79+
- name: Attach to release
80+
uses: softprops/action-gh-release@a929a66f232c1b11af63782948aa2210f981808a # PR#109
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
with:
84+
files: |
85+
python-dist/*
86+
debs.tar.xz
87+
# if it's not already published, keep the release as a draft.
88+
draft: true
89+
# mark it as a prerelease if the tag contains 'rc'.
90+
prerelease: ${{ contains(github.ref, 'rc') }}

changelog.d/10379.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add Github Actions workflow to attach release artifacts to release.

0 commit comments

Comments
 (0)