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

Enable cd workflow #35

Merged
merged 5 commits into from
Nov 17, 2021
Merged

Enable cd workflow #35

merged 5 commits into from
Nov 17, 2021

Conversation

justusbunsi
Copy link
Member

@justusbunsi justusbunsi commented Nov 1, 2021

To reduce manual overhead on releases, this can be automated.

@justusbunsi
Copy link
Member Author

Referring to these docs: https://www.jenkins.io/doc/developer/publishing/releasing-cd/

@lafriks
Copy link
Contributor

lafriks commented Nov 1, 2021

I was wondering if there is really no way to release version only on tag and with tag number 🤔

@lafriks
Copy link
Contributor

lafriks commented Nov 1, 2021

I think you are missing .github/workflows/cd.yaml - template: https://github.com/jenkinsci/.github/blob/master/workflow-templates/cd.yaml

Maybe this template could be tuned to publish only tags and with tag as plugin version?

@justusbunsi
Copy link
Member Author

I think you are missing .github/workflows/cd.yaml - template: https://github.com/jenkinsci/.github/blob/master/workflow-templates/cd.yaml

Maybe this template could be tuned to publish only tags and with tag as plugin version?

😆 Had this locally and didn't noticed that it somehow got ignored from being added.

@justusbunsi
Copy link
Member Author

justusbunsi commented Nov 1, 2021

Wouldn't the current workflow template create a tag and release on behalf due to "Release drafter"?

EDIT: Based on the referenced docs it is possible to exclude at least on-push releases.

If you prefer to only deploy explicitly, not on every push, just comment out the check_run section in the workflow.

So I guess it would also be possible to run this workflow only on tag creation.

@lafriks
Copy link
Contributor

lafriks commented Nov 1, 2021

Oh, you are right, it will create tag/release from workflow 😞

I would prefer not to release on every merged PR but manually

@lafriks
Copy link
Contributor

lafriks commented Nov 1, 2021

We still need to define secrets for Maven/Artifactory before merging

@justusbunsi
Copy link
Member Author

We still need to define secrets for Maven/Artifactory before merging

This should be added automatically since the infra PR got merged.

@lafriks
Copy link
Contributor

lafriks commented Nov 1, 2021

yes, you are right, in fact they already are

.github/workflows/cd.yaml Outdated Show resolved Hide resolved
@justusbunsi
Copy link
Member Author

Oh, you are right, it will create tag/release from workflow 😞

I would prefer not to release on every merged PR but manually

I'm not 100% sure if this really is the case. Regarding the docs there are some labels indicating merges "of interest". As long as there is none of these, the main branch doesn't get released. Maybe I am missing something.
Let's investigate the behaviour and adjust this PR according to our needs before merging. Maybe we can configure more than we see right now.

@lafriks
Copy link
Contributor

lafriks commented Nov 1, 2021

I still would prefer to use this part ;)
attels

@justusbunsi
Copy link
Member Author

Do we keep the versioning as if it would be fully automated?

@lafriks
Copy link
Contributor

lafriks commented Nov 1, 2021

Yes, I don't think there is other option, imho. If there is maybe it can be somehow done using workflow inputs to specify version number: https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/

@justusbunsi
Copy link
Member Author

justusbunsi commented Nov 1, 2021

If there is maybe it can be somehow done using workflow inputs to specify version number: https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/

This works pretty well. Have used it a few times. But not with Java projects.

EDIT: Referring to https://www.jenkins.io/doc/developer/publishing/releasing-cd/#pom-file-modifications, there are different versioning strategies. I've picked the first but we could do releases with Gitea patches in an automated way using the workflow dispatch feature.

@lafriks
Copy link
Contributor

lafriks commented Nov 2, 2021

that acutaly sounds good

@justusbunsi
Copy link
Member Author

You mean changing the versioning strategy or release with Gitea patches? Or both? 😀

@lafriks
Copy link
Contributor

lafriks commented Nov 2, 2021

I mean manually changing version and than manually triggering release workflow

@lafriks
Copy link
Contributor

lafriks commented Nov 2, 2021

We can still manually manage this part:
attels

@justusbunsi
Copy link
Member Author

@lafriks Apologies for the delayed response. 🙂 Concluding all the comments above it seems that we want to manually create tag and then have the GitHub actions automatically craft a release based on that tag and automatically create a changelog using release-drafter.

We would have two options regarding version value in pom.xml. Not sure if any of both has disadvantage over the other one:

  • Keep a placeholder and not update the version upon a release and just use the tag name during release build as version value
  • Manually bump the version before tagging

Does this sums it up? If so, I'll modify the scripts according to that.

justusbunsi and others added 3 commits November 7, 2021 16:19
Signed-off-by: Steven Kriegler <[email protected]>
Signed-off-by: Steven Kriegler <[email protected]>
@justusbunsi
Copy link
Member Author

justusbunsi commented Nov 7, 2021

@lafriks Hrm... I struggle to understand how the described behavior can be integrated into the current workflow without knowing how exactly it behaves. How about first see the current release in action before changing the automation? There won't be automatic releases since the workflow only reacts to dispatch events, so we have full control over it right now.

As discussed above, I've changed the pom.xml to use the second approach from the docs but also dropped the maven.config change regarding changelist format. So it should result in a proper 1.4.0. Maybe the tag name will differ from the others.

If this is ok for you, then let's find out what happens. 🙈

@justusbunsi justusbunsi marked this pull request as ready for review November 7, 2021 16:25
@lafriks
Copy link
Contributor

lafriks commented Nov 17, 2021

Ok, let's see what happens :)

@justusbunsi justusbunsi merged commit 9eb9474 into jenkinsci:master Nov 17, 2021
@justusbunsi justusbunsi deleted the enable-cd branch November 17, 2021 18:03
viceice referenced this pull request in visualon/jenkins-gitea-plugin Nov 24, 2021
* Enable cd workflow (#35)

* Enable cd workflow

Signed-off-by: Steven Kriegler <[email protected]>

* Add missing GitHub workflow

Signed-off-by: Steven Kriegler <[email protected]>

* Update .github/workflows/cd.yaml

Co-authored-by: Lauris BH <[email protected]>

* Switch back to classic version syntax

Co-authored-by: Lauris BH <[email protected]>

* Bump version to 1.5.0 (jenkinsci#42)

Additionally: Fix tag/release template to match previous releases

* Fix release versioning + incremental builds (jenkinsci#43)

* Add alt-texts to badges

This is a commit for letting the status checks fail.

* Lower the release version

* Re-Add changelist to version

* Opt-out incremental suffix during release

See: jenkins-infra/jenkins-maven-cd-action#13

* Auto-incrementalify after release

* Fix JENKINS-67068 (jenkinsci#44)

As a result of PR #29 it happens that some users cannot fetch branches
with slashes in their names anymore.

Regression from: JENKINS-65796

Co-authored-by: Steven <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
justusbunsi added a commit that referenced this pull request Jun 19, 2024
Most of the plugins I use fully migrated to JEP-229[^1]. It seems stable
enough and reduces manual overhead when releasing the plugin.

After quick chat with @lafriks in Discord, we decided to fully enable
automated releases. The first part happened in #35. I followed the
official docs[^2].

This will change the versioning pattern to `<amount-of-commits-on-main-branch>.v<HEAD>`.
When the next release is crafted, we should add a note to the relase
about this version change.

I also configured Dependabot to get monthly updates for our dependencies.

[^1]: https://github.com/jenkinsci/jep/blob/master/jep/229/README.adoc
[^2]: https://www.jenkins.io/doc/developer/publishing/releasing-cd/

Signed-off-by: justusbunsi <[email protected]>
justusbunsi added a commit that referenced this pull request Jun 19, 2024
Most of the plugins I use fully migrated to JEP-229[^1]. It seems stable
enough and reduces manual overhead when releasing the plugin.

After quick chat with @lafriks in Discord, we decided to fully enable
automated releases. The first part happened in #35. I followed the
official docs[^2].

This will change the versioning pattern to `<amount-of-commits-on-main-branch>.v<HEAD>`.
When the next release is crafted, we should add a note to the relase
about this version change.

I also configured Dependabot to get monthly updates for our dependencies.

[^1]: https://github.com/jenkinsci/jep/blob/master/jep/229/README.adoc
[^2]: https://www.jenkins.io/doc/developer/publishing/releasing-cd/

Signed-off-by: justusbunsi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants