Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace an unmaintained action #781

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 12 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,19 @@ jobs:
- name: Verify index migration from 0.3.x to 0.4.x
run: hack/verify-index-migration.sh

- name: Create a new release
- name: Make release notes
if: contains(github.ref, 'tags')
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
run: |
echo 'RELEASE_NOTES<<EOF' >> $GITHUB_ENV
TAG=$GITHUB_REF_NAME hack/make-release-notes.sh >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
Comment on lines +69 to +71
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, do you mind explaining how this works. having trouble following along how we connect $GITHUB_ENV to ${{ env.RELEASE_NOTES }} below.

Copy link
Contributor Author

@JohnTitor JohnTitor Jun 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable.
TL;DR we can set an env var by that way (we have to pass the release notes content to create_release).


- name: Upload binaries to the new release
- name: Create a new release
if: contains(github.ref, 'tags')
uses: svenstaro/upload-release-action@v2
id: create_release
uses: softprops/action-gh-release@v1
with:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also add fail_on_unmatched_files: true (if not already set by default) as a safeguard?

repo_token: ${{ secrets.GITHUB_TOKEN }}
file: out/krew*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
name: Release ${{ github.ref_name }}
files: out/krew*
body: ${{ env.RELEASE_NOTES }}
fail_on_unmatched_files: true