From 0a07e4a339735689c1473b0a34ae0726cb27107a Mon Sep 17 00:00:00 2001 From: Dave Kerr Date: Thu, 25 May 2023 11:58:01 -0700 Subject: [PATCH] docs: guide on attaching files to github release (#769) also update the title of the 'adding additional files' to make it a bit clearer that this section is 'updating additional files' and further differentiate it from this new section. --- README.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3e592f2..3d4797e 100644 --- a/README.md +++ b/README.md @@ -375,7 +375,7 @@ jobs: if: ${{ steps.release.outputs['packages/package-a--release_created'] }} ``` -## Adding additional files +## Updating additional files You can update additional files with the `extra-files` input. @@ -399,6 +399,34 @@ jobs: docs/getting-started.md ``` +## Attaching files to the GitHub release + +You can attach additional files, such as release artifacts, to the GitHub release that is created. The `gh` CLI tool, which is installed on all runners, can be used for this. + +This example uses the `gh` tool to attach the file `./artifact/some-build-artifact.zip`: + +```yaml +on: + push: + branches: + - main +name: release-please +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v3 + id: release + with: + release-type: node + - name: Upload Release Artifact + if: ${{ steps.release.outputs.release_created }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: + gh release upload ${{ steps.release.outputs.tag_name }} ./artifact/some-build-artifact.zip +``` + ## License Apache Version 2.0