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

[CI/CD] Fixes #1301: Created automated release workflow #1628

Merged
merged 5 commits into from
Feb 3, 2021

Conversation

birtony
Copy link
Contributor

@birtony birtony commented Feb 1, 2021

Issue This PR Addresses

Fixes #1301

Type of Change

  • Bugfix: Change which fixes an issue
  • New Feature: Change which adds functionality
  • Documentation Update: Change which improves documentation
  • UI: Change which improves UI

Description

Rebased and updated #1527. This PR adds an automated release workflow for GitHub Actions. It would allow us to create a new release by running npm version (DON'T RUN THIS CODE UNLESS YOU WANT TO MAKE A PRODUCTION RELEASE):

npm version minor -m "Release 1.6.0" 
git push upstream master
git push upstream 1.6.0

The workflow would also run the same checks as our node-js-ci workflow (test, lint, prettier) and generate a changelog to be included in the release.

type(category): description [flags]

Where type is one of the following:

    breaking
    build
    ci
    chore
    docs
    feat
    fix
    other
    perf
    refactor
    revert
    style
    test

Example of Generated Changelog:

image

Example of Workflow Status in GitHub Actions:

image
image

How to Test

Create some releases on your forked telescope repository!

  • You can test the workflow by merging it into your forked repository and pushing a new tag to it:

git merge upstream/issue1301-create-release-workflow
npm version minor -m "Release 1.6.0"
it push upstream master
git push upstream 1.6.0

  • Using GitHub CLI might make it easier to checkout to issue1301-create-release-workflow directly by executing the following:

gh pr checkout 1628

Checklist

  • Quality: This PR builds and passes our npm test and works locally
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not (if applicable)
  • Documentation: This PR includes updated/added documentation to user exposed functionality or configuration variables are added/changed or an explanation of why it does not(if applicable)

@birtony birtony force-pushed the issue1301-create-release-workflow branch from 4a29ed7 to 22ce682 Compare February 1, 2021 05:22
@birtony birtony self-assigned this Feb 1, 2021
@birtony birtony added area: CI/CD Continuous integration / Continuous delivery area: tools developer experience Helping the Developer Experience Priority: Medium type: enhancement New feature or request labels Feb 1, 2021
@birtony birtony added this to the 1.6 Release milestone Feb 1, 2021
@birtony
Copy link
Contributor Author

birtony commented Feb 1, 2021

Currently, GitHub does not seem to provide an easy way to postpone the execution of one workflow until the other one succeeds. In this PR I have used https://github.com/lewagon/wait-on-check-action to try to integrate a workaround. However, I could not achieve it work properly for every case. In addition, it does not seem to be a too efficient solution as it makes a call to check the status of the other workflow every time the interval expires. It would be great not to have to run rest/lint/prettier on the exact same version of code twice, but it looks like it might be the best solution for now. Please, feel free to share your opinions below.

CC @manekenpix @humphd @PedroFonsecaDEV @HyperTHD

@humphd
Copy link
Contributor

humphd commented Feb 1, 2021

I would do the simple thing and just duplicate the lint/test steps in the release. It doesn't matter that it's duplicated. Passing the tests twice is more proof that production isn't going to get code that can't be built.

@birtony
Copy link
Contributor Author

birtony commented Feb 1, 2021

I would do the simple thing and just duplicate the lint/test steps in the release. It doesn't matter that it's duplicated. Passing the tests twice is more proof that production isn't going to get code that can't be built.

Yeah, that makes sense. I will proceed to incorporate that logic into this PR.

chrispinkney
chrispinkney previously approved these changes Feb 1, 2021
Copy link
Contributor

@chrispinkney chrispinkney left a comment

Choose a reason for hiding this comment

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

I think this is good, or at least it seems like it's functioning as expected.

🤤 🤤 🤤 🤤

.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Show resolved Hide resolved
@birtony
Copy link
Contributor Author

birtony commented Feb 3, 2021

Updated the workflow to remove the package version bump action. We should use npm version to generate a release as described in the updated description to this pr.

Copy link
Contributor

@humphd humphd left a comment

Choose a reason for hiding this comment

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

Do you want to add preversion to our package.json script to run npm test? I think that's a logical approach.

Copy link
Contributor

@HyperTHD HyperTHD left a comment

Choose a reason for hiding this comment

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

Perfection
LGTM. Can't wait to see this in action later this week. I do agree with adding pre-version. Extra crisp test case passing won't hurt

@birtony
Copy link
Contributor Author

birtony commented Feb 3, 2021

@humphd @HyperTHD agreed. Let land this one first and take care of that in a subsequent PR. I will take care of it.

@birtony birtony merged commit e05ca9f into master Feb 3, 2021
@birtony birtony deleted the issue1301-create-release-workflow branch February 3, 2021 01:05
izhuravlev pushed a commit to izhuravlev/telescope that referenced this pull request Feb 5, 2021
…eneca-CDOT#1628)

* ci(improvement): Created release automation workflow

Co-authored-by: Andy Yang <yzwdroid@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: CI/CD Continuous integration / Continuous delivery area: tools developer experience Helping the Developer Experience type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add github action to automate the release process.
5 participants