Skip to content

Commit 335bd19

Browse files
committed
Upload PDF as release asset
1 parent b1cc0b8 commit 335bd19

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: CI
33
on:
44
push:
55
pull_request:
6+
release:
7+
types: [created]
68

79
workflow_dispatch:
810

@@ -34,4 +36,25 @@ jobs:
3436
- uses: actions/upload-artifact@v4.5.0
3537
with:
3638
path: tutorial.pdf
39+
name: tutorial
3740
if-no-files-found: error
41+
42+
release:
43+
name: Upload PDF to release
44+
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
45+
runs-on: ubuntu-latest
46+
needs: build
47+
permissions:
48+
contents: write
49+
50+
steps:
51+
- name: Download PDF artifact
52+
uses: actions/download-artifact@v5
53+
with:
54+
name: tutorial
55+
56+
- name: Upload PDF to release
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
run: |
60+
gh release upload --repo ${{ github.event.repository.full_name }} ${{ github.event.release.tag_name }} tutorial.pdf --clobber

0 commit comments

Comments
 (0)