create_release.js 627 B

1234567891011121314151617181920
  1. // Uses Github's API to create the release and wait for result.
  2. // We use a JS script since github CLI doesn't provide a way to wait for the release's creation and returns immediately.
  3. module.exports = async (github, context, core) => {
  4. try {
  5. const response = await github.rest.repos.createRelease({
  6. draft: false,
  7. generate_release_notes: true,
  8. name: process.env.RELEASE_TAG,
  9. owner: context.repo.owner,
  10. prerelease: false,
  11. repo: context.repo.repo,
  12. tag_name: process.env.RELEASE_TAG,
  13. });
  14. core.setOutput('upload_url', response.data.upload_url);
  15. } catch (error) {
  16. core.setFailed(error.message);
  17. }
  18. }