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

Please support multi-project publishing #16

Open
Vampire opened this issue May 3, 2018 · 7 comments
Open

Please support multi-project publishing #16

Vampire opened this issue May 3, 2018 · 7 comments

Comments

@Vampire
Copy link
Contributor

Vampire commented May 3, 2018

I have a root project and two sub-modules in the same GitHub repo.
If I apply the plugin to all projects, it fails because of "release does already exist".
Of course I can only apply the plugin to the root project and collect the artifacts to be published there, but it would of course be nice if this just worked if possible. :-)

@Larusso
Copy link
Member

Larusso commented May 3, 2018

Hmm never had this setup in mind. But I will try and play around and see how hard it is to support.

@Vampire
Copy link
Contributor Author

Vampire commented May 3, 2018

Maybe it is sufficient to be able to configure whether an existing tag should fail the build or add the files or something like that.

@Vampire
Copy link
Contributor Author

Vampire commented May 3, 2018

Actually I'm happy with how I have it now, with from allprojects.configurations.archives.artifacts.files and only applied to root project.

@Larusso
Copy link
Member

Larusso commented May 3, 2018

I had in mind to reference configurations:

def "publish files from configurations"() {
given: "a few files"
createFile("fileToPublish1.json") << "test content"
createFile("fileToPublish2.json") << "test content"
createFile("fileToPublish3.json") << "test content"
createFile("fileToPublish4.json") << "test content"
and: "a buildfile with publish task and custom configuration"
buildFile << """
configurations {
githubAssets
}
dependencies {
githubAssets files("fileToPublish1.json")
githubAssets files("fileToPublish2.json")
githubAssets files("fileToPublish3.json")
githubAssets files("fileToPublish4.json")
}
task testPublish(type:wooga.gradle.github.publish.tasks.GithubPublish) {
from configurations.githubAssets
tagName = "$tagName"
}
"""
when:
runTasksSuccessfully("testPublish")
then:
def release = getRelease(tagName)
!release.isDraft()
def assets = release.assets
assets.size() == 4
assets.every() { it.name =~ /fileToPublish\d\.json/ }
where:
tagName = "v0.3.0-GithubPublishAssetsIntegrationSpec"
}

I have no test with a multi project setup at the moment. I should add this because configuration and artifact handling is a little bit fuzzy on my part.

But like in the test you could define dependencies to the sub project configuration or fileTree's

Updating Releases is on my roadmap but I had no real use case.

@Vampire
Copy link
Contributor Author

Vampire commented May 3, 2018

Yeah, seen this in the docs, but I've seen no point in declaring my artifacts again, when what I want to publish is already defined as artifacts for the archives configuration as shown in my example. You could add a test for that though.

@Larusso
Copy link
Member

Larusso commented May 3, 2018

OK. from allprojects.configurations.archives.artifacts.files but this means really every sub project. But since GithubPublish is just a CopySpec all kind of configuration incantations should work. But I will add a spec for your multi project usecase and add an entry in the docs.

@Vampire
Copy link
Contributor Author

Vampire commented May 3, 2018

Yes, in my case this is exactly what I wanted and yes, being a CopySpec is good for flexibility :-)

Larusso added a commit that referenced this issue Jun 1, 2021
Description
===========

This patch adds multiple smaller changes and updates into one.
Creating multiple patches would seem silly as some of them are really
one liners.

Update to gradle 6.9
--------------------

Gradle released one last version in the 6.x range which contains a few
additions only available in Gradle 7.

> It will take a while for everyone to upgrade to the latest major
> Gradle 7.0 release. In order to bring some of the improvements sooner
> to users that can’t upgrade to Gradle 7.0 yet, we released
> Gradle 6.9 backport release.
> Gradle 6.9 backports limited support for Java 16, dynamic versions
> in the plugins block, and native support for Apple Silicon.
> See [release](https://go.gradle.com/e/68052/6-9-release-notes-html/dhvx4x/504521087?h=84TuUktWbb5clAIdOkfNQJf3cGD2jpV0M9TzM-Wu6Dc) notes for details.

Github assets API change
------------------------

The `getAssets()` API has a deprecation warning

> Deprecated
> The behavior of this method will change in a future release.
> It will then provide cached assets as provided by assets().
> Use listAssets() instead to fetch up-to-date information of assets.

I switched to `listAssets` to keep the same behavior for now.
In the future we need to check which API is best suited for our usecases.

Add a missing asset upload test case
------------------------------------

I finally provided the testcase outlined in issue #16.
This added test is just here to proov that this usecase is
still supported.

Other
-----

Then there is smaller changes in the documentation and Readme.

Changes
=======

* ![UPDATE] ![GRADLE] to `6.9`
* ![UPDATE] `net.wooga.plugins` to `2.1.1`
* ![IMPROVE] asset uploads tests
* ![CHANGE] use `listAssets()` instead of `getAssets` from github API
* ![IMPROVE] smaller updates to README.md
Larusso added a commit that referenced this issue Jun 1, 2021
Description
===========

This patch adds multiple smaller changes and updates into one.
Creating multiple patches would seem silly as some of them are really
one liners.

Update to gradle 6.9
--------------------

Gradle released one last version in the 6.x range which contains a few
additions only available in Gradle 7.

> It will take a while for everyone to upgrade to the latest major
> Gradle 7.0 release. In order to bring some of the improvements sooner
> to users that can’t upgrade to Gradle 7.0 yet, we released
> Gradle 6.9 backport release.
> Gradle 6.9 backports limited support for Java 16, dynamic versions
> in the plugins block, and native support for Apple Silicon.
> See [release](https://go.gradle.com/e/68052/6-9-release-notes-html/dhvx4x/504521087?h=84TuUktWbb5clAIdOkfNQJf3cGD2jpV0M9TzM-Wu6Dc) notes for details.

Github assets API change
------------------------

The `getAssets()` API has a deprecation warning

> Deprecated
> The behavior of this method will change in a future release.
> It will then provide cached assets as provided by assets().
> Use listAssets() instead to fetch up-to-date information of assets.

I switched to `listAssets` to keep the same behavior for now.
In the future we need to check which API is best suited for our usecases.

Add a missing asset upload test case
------------------------------------

I finally provided the testcase outlined in issue #16.
This added test is just here to proov that this usecase is
still supported.

Other
-----

Then there is smaller changes in the documentation and Readme.

Changes
=======

* ![UPDATE] ![GRADLE] to `6.9`
* ![UPDATE] `net.wooga.plugins` to `2.1.1`
* ![IMPROVE] asset uploads tests
* ![CHANGE] use `listAssets()` instead of `getAssets` from github API
* ![IMPROVE] smaller updates to README.md
Larusso added a commit that referenced this issue Jun 2, 2021
Description
===========

This patch adds multiple smaller changes and updates into one.
Creating multiple patches would seem silly as some of them are really
one liners.

Update to gradle 6.9
--------------------

Gradle released one last version in the 6.x range which contains a few
additions only available in Gradle 7.

> It will take a while for everyone to upgrade to the latest major
> Gradle 7.0 release. In order to bring some of the improvements sooner
> to users that can’t upgrade to Gradle 7.0 yet, we released
> Gradle 6.9 backport release.
> Gradle 6.9 backports limited support for Java 16, dynamic versions
> in the plugins block, and native support for Apple Silicon.
> See [release](https://go.gradle.com/e/68052/6-9-release-notes-html/dhvx4x/504521087?h=84TuUktWbb5clAIdOkfNQJf3cGD2jpV0M9TzM-Wu6Dc) notes for details.

Github assets API change
------------------------

The `getAssets()` API has a deprecation warning

> Deprecated
> The behavior of this method will change in a future release.
> It will then provide cached assets as provided by assets().
> Use listAssets() instead to fetch up-to-date information of assets.

I switched to `listAssets` to keep the same behavior for now.
In the future we need to check which API is best suited for our usecases.

Add a missing asset upload test case
------------------------------------

I finally provided the testcase outlined in issue #16.
This added test is just here to proov that this usecase is
still supported.

Other
-----

Then there is smaller changes in the documentation and Readme.

Changes
=======

* ![UPDATE] ![GRADLE] to `6.9`
* ![UPDATE] `net.wooga.plugins` to `2.1.1`
* ![IMPROVE] asset uploads tests
* ![CHANGE] use `listAssets()` instead of `getAssets` from github API
* ![IMPROVE] smaller updates to README.md
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

No branches or pull requests

2 participants