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

Adds automatic release action #17594

Merged
merged 21 commits into from Feb 24, 2022
Merged

Adds automatic release action #17594

merged 21 commits into from Feb 24, 2022

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented May 19, 2021

This PR aims to set up a automatic build process.

What this action does:

This action always needs to be triggered manually in the actions tab. This is possible with two purposes:

New release in the current major version

When a new release has to be done this action simply needs to be triggered manually, without setting a version.
The action will then:

  • Check if the user who triggered the action is in the team matomo-org/release-team
    --> If this is not the case the action will abort with an error
  • The version contained in the file core/Version.php will be extracted and used
    --> If a tag with the determined version already exists the action will abort with an error
  • A new tag for that version will be created
  • A new build will be created using the script .github/scripts/build-package.sh
    --> This will create piwik and matomo release archives in zip and tar.gz as well as signature files ending on .asc
  • In addition to this a new release will be created in the repository and the matomo release archives and signatures will be attached. Depending on the version this will be automatically marked as pre-release or not. The release message for each release type can be adjusted if needed. The result can be seen in my fork: Pre-Release | Normal release

Release in LTS version (or re-release of a broken one)

When releasing a LTS version we can't simply trigger the action. Instead we need to create the tag manually first. After this has been done, the actions needs to be triggered while providing the tagged version number in the according input:
image

The action will then:

  • Check if the user who triggered the action is in the team matomo-org/release-team
    --> If this is not the case the action will abort with an error
  • The action now checks if a tag for the given version exists
    --> If no tag exists the action will abort with an error
  • A new build will be created using the script .github/scripts/build-package.sh
    --> This will create piwik and matomo release archives in zip and tar.gz as well as signature files ending on .asc
  • As above a new release in the repo will be created for the tag

Additionally the action could also be used to re-release a "broken" release. Even though this should be an uncommon use case, it's possible to simply trigger the action with a version number that already exists. For pre-releases the script should simply run through and recreate the archives. They should then be replaced in the repo release. For stable releases this currently won't work as the build script aborts if the version is already available on our build server

Requirements:

The team matomo-org/release-team needs to be filled with the persons who should be able to trigger this action. This is currently a private group, so no one can directly see who actually has the permission

The action requires the following repository tokens to be set up:

secret name secret value description
GPG_CERTIFICATE ASCII armored or Base64 encoded GPG certificate that is used to create the signatures for the archives
GPG_CERTIFICATE_PASS Passphrase of the GPG key
RELEASE_PASSWORD Password required to trigger the release action

Testing / Feedback

If someone wants to test the process feel free to get in touch on slack. It's set up on my fork and uses a slightly adjusted build script that uploads the releases to another account. Can give you access...


fixes matomo-org/matomo-package#119

@sgiehl sgiehl added RFC Indicates the issue is a request for comments where the author is looking for feedback. Needs Review PRs that need a code review Better processes Indicates an issue is about improving how we work. labels May 19, 2021
@mattab
Copy link
Member

mattab commented May 19, 2021

Great to see this progress!

Btw another important step to complete at the end will be to update the instructions at: https://matomo.org/blog/2014/11/verify-signatures-piwik-packages/

@flamisz
Copy link
Contributor

flamisz commented May 30, 2021

Is it ready to review? I see the needs review label but it's still in draft.

@sgiehl
Copy link
Member Author

sgiehl commented May 31, 2021

@flamisz That's because it requires some setup before it could be merged. It's also only a suggestion from my side how the process could work. So it has the needs review and rfc label actually to get some feedback.

@github-actions github-actions bot added the Stale The label used by the Close Stale Issues action label Jun 8, 2021
@sgiehl sgiehl added Do not close PRs with this label won't be marked as stale by the Close Stale Issues action and removed Stale The label used by the Close Stale Issues action labels Jun 11, 2021
@github-actions github-actions bot added Stale The label used by the Close Stale Issues action and removed Stale The label used by the Close Stale Issues action labels Jun 19, 2021
@sgiehl
Copy link
Member Author

sgiehl commented Jun 25, 2021

@mattab @tsteur would be awesome if you can find some time to look into this, so we maybe could set up the automatic release soon.

@mattab
Copy link
Member

mattab commented Jun 25, 2021

From my end it looks fantastic @sgiehl - great work! Will save us all time and make our release process faster 🚀

@github-actions github-actions bot added Stale The label used by the Close Stale Issues action and removed Stale The label used by the Close Stale Issues action labels Jul 3, 2021
@github-actions github-actions bot added Stale The label used by the Close Stale Issues action and removed Stale The label used by the Close Stale Issues action labels Jul 11, 2021
@github-actions github-actions bot added Stale The label used by the Close Stale Issues action and removed Stale The label used by the Close Stale Issues action labels Jul 19, 2021
@tsteur
Copy link
Member

tsteur commented Jul 20, 2021

@sgiehl what's the status here? can we configure (probably requires @mattab for some keys) and merge and test it?

@sgiehl
Copy link
Member Author

sgiehl commented Jul 20, 2021

@tsteur Not sure if someone wants to do a code review. Otherwise we can configure it

@tsteur
Copy link
Member

tsteur commented Jul 20, 2021

👍 wasn't sure as it was set to draft. Generally had a look over it and looked ok-ish but don't know the details. I guess we'd mostly want to test it to ensure it works. Maybe in beginning we wouldn't test it with ssh piwik-builds but some other account.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2021

This issue is in "needs review" but there has been no activity for 7 days. ping @matomo-org/core-reviewers

@github-actions github-actions bot added the Stale The label used by the Close Stale Issues action label Aug 2, 2021
@sgiehl
Copy link
Member Author

sgiehl commented Feb 18, 2022

@Findus23 applied some of the fixes

Copy link
Member

@tsteur tsteur left a comment

Choose a reason for hiding this comment

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

Left a few minor comments. The password check we could add after it's been merged.

Otherwise looks all good to merge from my perspective once the comments have been addressed and once the process of using this is documented and how it works (eg how to allow someone to release etc)

.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
@tsteur
Copy link
Member

tsteur commented Feb 22, 2022

👍

@sgiehl
Copy link
Member Author

sgiehl commented Feb 23, 2022

Guess we actually could merge this one now. Once the secrets have been added we can give it a first try...

@sgiehl sgiehl removed the Needs Review PRs that need a code review label Feb 23, 2022
@justinvelluppillai justinvelluppillai merged commit 4c0e328 into 4.x-dev Feb 24, 2022
@justinvelluppillai justinvelluppillai deleted the release-action branch February 24, 2022 22:46
justinvelluppillai pushed a commit that referenced this pull request Feb 24, 2022
* Adds automatic release action

* remove test branch usage

* set proper permissions

* use the commit hashes of the versions for external actions

* remove invalid permission property

* use local version of build script

* various improvements

* disallow creating automated tags from branches other than 4.x-dev and next_release

* apply latest build script changes

* manually import gpg key instead of using an action

* remove all remote work

* also attach piwik.* files to the release

* some cleanup

* Adds confirmation box to action run

* apply review feedback

* add password check

* allow releases to be triggered from any development branch

* only allow beta releases from development branches

* improve permissions

* add some comments about required secrets

* use default github token to check group members
@justinvelluppillai justinvelluppillai added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. and removed Do not close PRs with this label won't be marked as stale by the Close Stale Issues action labels Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Better processes Indicates an issue is about improving how we work. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automate the packaging of Matomo beta/rc/stable releases via Github actions
6 participants