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

Prepare publish of com.gradleup.shadow #930

Merged
merged 24 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: CI

on:
pull_request:
branches:
- main
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
Expand All @@ -28,3 +26,22 @@ jobs:
gradle-home-cache-cleanup: true
validate-wrappers: true
- run: ./gradlew build

publish-snapshot:
needs: build
runs-on: ubuntu-latest
if: github.repository == 'GradleUp/shadow' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: true
# Disable CC due to https://github.com/gradle/gradle/issues/22779
- run: ./gradlew publish --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USER }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
push:
tags:
- '**'

jobs:
release:
runs-on: ubuntu-latest
if: github.repository == 'GradleUp/shadow'
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: true
# Disable CC due to https://github.com/gradle/gradle/issues/22779
- run: ./gradlew publish --no-configuration-cache
Goooler marked this conversation as resolved.
Show resolved Hide resolved
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USER }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_KEY_PASSWORD }}
- name: Extract release notes
uses: ffurrer2/extract-release-notes@v2
with:
release_notes_file: RELEASE_NOTES.md
- name: Create release
run: gh release create ${{ github.ref_name }} --notes-file RELEASE_NOTES.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100 changes: 100 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Change Log

## [Unreleased]

**Changed**

- Bump the min Gradle requirement from `8.0.0` to `8.3`. ([#876](https://github.com/johnrengelman/shadow/pull/876))
- Support Java 21. ([#876](https://github.com/johnrengelman/shadow/pull/876))
- Use new file permission API from Gradle 8.3. ([#876](https://github.com/johnrengelman/shadow/pull/876))

**Fixed**

- Fix for PropertiesFileTransformer breaks Reproducible builds in
`8.1.1`. ([#858](https://github.com/johnrengelman/shadow/pull/858))

## [8.1.1] - 2023-03-21

### What's Changed

* Replace deprecated ConfigureUtil by @Goooler in https://github.com/johnrengelman/shadow/pull/826
* Polish outdated configs by @Goooler in https://github.com/johnrengelman/shadow/pull/831
* Update plugin com.gradle.enterprise to v3.12.5 by @renovate in https://github.com/johnrengelman/shadow/pull/838
* Update dependency gradle to v8.0.2 by @renovate in https://github.com/johnrengelman/shadow/pull/844
* fix(deps): update dependency org.codehaus.plexus:plexus-utils to v3.5.1 by @renovate
in https://github.com/johnrengelman/shadow/pull/837
* chore(deps): update dependency prismjs to v1.27.0 [security] by @renovate
in https://github.com/johnrengelman/shadow/pull/828
* Encode transformed properties files with specified Charset by @scottsteen
in https://github.com/johnrengelman/shadow/pull/819
* chore(deps): update dependency vuepress to v1.9.9 by @renovate in https://github.com/johnrengelman/shadow/pull/842

### New Contributors

* @renovate made their first contribution in https://github.com/johnrengelman/shadow/pull/838
* @scottsteen made their first contribution in https://github.com/johnrengelman/shadow/pull/819

**Full Changelog**: https://github.com/johnrengelman/shadow/compare/8.1.0...8.1.1

## [8.1.0] - 2023-02-27

### What's Changed

* Minor cleanups by @Goooler in https://github.com/johnrengelman/shadow/pull/823
* Support config cache by @Goooler in https://github.com/johnrengelman/shadow/pull/824
* Fix RelocatorRemapper: do not map inner class name if not changed by @Him188
in https://github.com/johnrengelman/shadow/pull/793

### New Contributors

* @Him188 made their first contribution in https://github.com/johnrengelman/shadow/pull/793

**Full Changelog**: https://github.com/johnrengelman/shadow/compare/8.0.0...8.1.0

## [8.0.0] - 2023-02-25

### What's Changed

* Fix the plugin dependency identifier in the docs by @lnhrdt
in [#754](https://github.com/johnrengelman/shadow/pull/754)
* mergeGroovyExtensionModules() not working with Groovy 2.5+ by @paulk-asert
in [#779](https://github.com/johnrengelman/shadow/pull/779)
* Upgrade to ASM 9.3 to support JDK 19. by @vyazelenko in https://github.com/johnrengelman/shadow/pull/770
* Do not add a dependencies block if it's already there by @desiderantes
in https://github.com/johnrengelman/shadow/pull/769
* Update README with new badge and links by @ThexXTURBOXx in https://github.com/johnrengelman/shadow/pull/743
* Fix value not set when rawString is true. by @qian0817 in https://github.com/johnrengelman/shadow/pull/765
* Mark the Log4j2PluginsCacheFileTransformer as cacheable. by @staktrace
in https://github.com/johnrengelman/shadow/pull/724
* Fix retrieval of dependencies node when publishing by @netomi in https://github.com/johnrengelman/shadow/pull/798
* Upgrade dependency ASM from `9.3` to `9.4` by @codecholeric in https://github.com/johnrengelman/shadow/pull/817
* Fix a typo of code comment in the minimizing page by @jebnix in https://github.com/johnrengelman/shadow/pull/800
* Prefer using plugin extensions over deprecated conventions by @eskatos
in https://github.com/johnrengelman/shadow/pull/821
* Introduce CleanProperties by @simPod in https://github.com/johnrengelman/shadow/pull/622
* Support Gradle 8.0 by @Goooler in https://github.com/johnrengelman/shadow/pull/822
* Updated dependencies , Gradle versions and Fix Test by @ElisaMin in https://github.com/johnrengelman/shadow/pull/791

### New Contributors

* @lnhrdt made their first contribution in https://github.com/johnrengelman/shadow/pull/754
* @paulk-asert made their first contribution in https://github.com/johnrengelman/shadow/pull/779
* @desiderantes made their first contribution in https://github.com/johnrengelman/shadow/pull/769
* @ThexXTURBOXx made their first contribution in https://github.com/johnrengelman/shadow/pull/743
* @qian0817 made their first contribution in https://github.com/johnrengelman/shadow/pull/765
* @staktrace made their first contribution in https://github.com/johnrengelman/shadow/pull/724
* @netomi made their first contribution in https://github.com/johnrengelman/shadow/pull/798
* @codecholeric made their first contribution in https://github.com/johnrengelman/shadow/pull/817
* @jebnix made their first contribution in https://github.com/johnrengelman/shadow/pull/800
* @eskatos made their first contribution in https://github.com/johnrengelman/shadow/pull/821
* @simPod made their first contribution in https://github.com/johnrengelman/shadow/pull/622
* @Goooler made their first contribution in https://github.com/johnrengelman/shadow/pull/822
* @ElisaMin made their first contribution in https://github.com/johnrengelman/shadow/pull/791

**Full Changelog**: https://github.com/johnrengelman/shadow/compare/7.1.2...8.0.0


[Unreleased]: https://github.com/GradleUp/shadow/compare/8.1.1...HEAD
[8.1.1]: https://github.com/GradleUp/shadow/releases/tag/8.1.1
[8.1.0]: https://github.com/GradleUp/shadow/releases/tag/8.1.0
[8.0.0]: https://github.com/GradleUp/shadow/releases/tag/8.0.0
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ Read the [User Guide](https://imperceptiblethoughts.com/shadow/)!

## Current Status

[![Download](https://img.shields.io/gradle-plugin-portal/v/com.github.johnrengelman.shadow)](https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow)
[![Maven Central](https://img.shields.io/maven-central/v/com.gradleup.shadow/shadow-gradle-plugin)](https://central.sonatype.com/artifact/com.gradleup.shadow/shadow-gradle-plugin)
[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/com.gradleup.shadow/shadow-gradle-plugin?&server=https://oss.sonatype.org/)](https://oss.sonatype.org/content/repositories/snapshots/com/gradleup/shadow/)
[![Plugin Portal](https://img.shields.io/gradle-plugin-portal/v/com.gradleup.shadow)](https://plugins.gradle.org/plugin/com.gradleup.shadow)
[![CI](https://github.com/GradleUp/shadow/actions/workflows/ci.yml/badge.svg?branch=main&event=push)](https://github.com/GradleUp/shadow/actions/workflows/ci.yml?query=branch:main+event:push)
[![License](https://img.shields.io/github/license/GradleUp/shadow.svg)](LICENSE)

Expand Down
40 changes: 40 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Releasing

1. Update the `VERSION_NAME` in `gradle.properties` to the release version.

2. Update the `CHANGELOG.md`:
1. Change the `Unreleased` header to the release version.
2. Add a link URL to ensure the header link works.
3. Add a new `Unreleased` section to the top.

3. Update the `README.md` so the "Download" section reflects the new release version and the
snapshot section reflects the next "SNAPSHOT" version.

4. Commit

```
$ git commit -am "Prepare version X.Y.Z"
```

5. Tag

```
$ git tag -am "Version X.Y.Z" X.Y.Z
```

6. Update the `VERSION_NAME` in `gradle.properties` to the next "SNAPSHOT" version.

7. Commit

```
$ git commit -am "Prepare next development version"
```

8. Push!

```
$ git push && git push --tags
```

This will trigger a GitHub Action workflow which will create a GitHub release and upload the
release artifacts to Maven Central.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ plugins {
id 'project-report'
id 'idea'
id 'java-gradle-plugin'
id 'signing'
id 'com.gradle.plugin-publish' version '1.2.1'
id 'org.ajoberstar.git-publish' version '4.2.2'
id 'com.github.node-gradle.node' version '7.0.2'
id 'com.vanniktech.maven.publish' version "0.29.0"
}

apply plugin: ShadowPlugin
Expand All @@ -32,7 +32,7 @@ tasks.withType(Test).configureEach {
maxHeapSize "1g"
}

systemProperty 'java.io.tmpdir', project.layout.buildDirectory.asFile.get().absolutePath
systemProperty 'shadowVersion', version

// Required to test configuration cache in tests when using withDebug()
// https://github.com/gradle/gradle/issues/22765#issuecomment-1339427241
Expand Down
28 changes: 27 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx4g -XX:MaxMetaspaceSize=2g
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configuration-cache=true
org.gradle.configuration-cache=true


GROUP=com.gradleup.shadow
Goooler marked this conversation as resolved.
Show resolved Hide resolved
POM_ARTIFACT_ID=shadow-gradle-plugin
VERSION_NAME=8.3.0-SNAPSHOT

SONATYPE_AUTOMATIC_RELEASE=true
SONATYPE_HOST=DEFAULT
RELEASE_SIGNING_ENABLED=true

POM_NAME=Shadow Gradle Plugin
POM_DESCRIPTION=Gradle version of Maven's Shade plugin.
POM_INCEPTION_YEAR=2024
POM_URL=https://github.com/GradleUp/shadow

POM_LICENSE_NAME=The Apache Software License, Version 2.0
POM_LICENSE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENSE_DIST=repo

POM_SCM_URL=https://github.com/GradleUp/shadow
POM_SCM_CONNECTION=scm:git:git://github.com/GradleUp/shadow.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/GradleUp/shadow.git

POM_DEVELOPER_ID=gradleup
POM_DEVELOPER_NAME=GradleUp developers
POM_DEVELOPER_URL=https://github.com/GradleUp
44 changes: 8 additions & 36 deletions gradle/publish.gradle
Original file line number Diff line number Diff line change
@@ -1,52 +1,24 @@
apply plugin: "com.gradle.plugin-publish"
apply plugin: "com.vanniktech.maven.publish"

group = 'com.github.johnrengelman'

if (System.env.CIRCLE_TAG && System.env.CIRCLE_TAG =~ /^\d\.\d\.\d$/) {
version = System.env.CIRCLE_TAG
} else {
version = file('src/main/resources/shadow-version.txt').text.trim()
if (!version.endsWith("-SNAPSHOT")) {
version = version + "-SNAPSHOT"
}
}
group = providers.gradleProperty("GROUP")
version = providers.gradleProperty("VERSION_NAME")

gradlePlugin {
website = 'https://github.com/johnrengelman/shadow'
vcsUrl = 'https://github.com/johnrengelman/shadow'
website = providers.gradleProperty("POM_URL")
vcsUrl = providers.gradleProperty("POM_URL")

plugins {
shadowPlugin {
id = 'com.github.johnrengelman.shadow'
id = 'com.gradleup.shadow'
implementationClass = 'com.github.jengelman.gradle.plugins.shadow.ShadowPlugin'
displayName = 'Shadow Plugin'
description = "Gradle plugin to create fat/uber JARs, apply file transforms, and relocate packages for applications and libraries. Gradle version of Maven's Shade plugin."
displayName = providers.gradleProperty("POM_NAME").orNull
description = providers.gradleProperty("POM_DESCRIPTION").orNull
tags.set(['onejar', 'shade', 'fatjar', 'uberjar'])
}
}
}

tasks.named('publishPlugins') {
doFirst {
if (version.endsWith("SNAPSHOT")) {
throw new GradleException('Cannot publish SNAPSHOT versions to Plugin Portal!')
}
}
notCompatibleWithConfigurationCache("https://github.com/gradle/gradle/issues/21283")
}

signing {
if (System.env.CI == 'true') {
def encodedSigningKey = findProperty("signingKey")
def signingKey = encodedSigningKey ? new String(encodedSigningKey.decodeBase64()) : null
def signingPassword = findProperty("signingPassword") as String
useInMemoryPgpKeys(signingKey, signingPassword)
}
// See https://github.com/johnrengelman/shadow/pull/831#discussion_r1119012328
required = false && gradle.taskGraph.hasTask("artifactoryPublish")
sign(publishing.publications)
}

tasks.register('release') {
dependsOn tasks.named('assemble'), tasks.named('publishPlugins'), tasks.named('gitPublishPush')
}
2 changes: 1 addition & 1 deletion src/docs/application-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ configured to contain the `Main-Class` attribute with the value specified in the
// Using Shadow with Application Plugin
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'

application {
mainClass = 'myapp.Main'
Expand Down
2 changes: 1 addition & 1 deletion src/docs/changes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Instead, use the `enableRelocation = true` and `relocationPrefix = "<new package
}
}

apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "com.gradleup.shadow"
```

- [Cédric Champeau](https://github.com/melix) - Support Gradle 7 [#624](https://github.com/johnrengelman/shadow/pull/624)
Expand Down
6 changes: 3 additions & 3 deletions src/docs/getting-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

```groovy no-plugins
plugins {
id 'com.github.johnrengelman.shadow' version '@version@'
id 'com.gradleup.shadow' version '@version@'
id 'java'
}
```
Expand All @@ -19,11 +19,11 @@ buildscript {
}
}

apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'
apply plugin: 'java'
```

**NOTE:** The correct maven coordinates for each version of Shadow can be found by referencing the Gradle Plugin documentation [here](https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow).
**NOTE:** The correct maven coordinates for each version of Shadow can be found by referencing the Gradle Plugin documentation [here](https://plugins.gradle.org/plugin/com.gradleup.shadow).

Shadow is a reactive plugin.
This means that applying Shadow by itself will perform no configuration on your project.
Expand Down
2 changes: 1 addition & 1 deletion src/docs/plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A simple Gradle plugin can use this feature by applying the `shadow` plugin and
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
id 'com.github.johnrengelman.shadow' version '@version@'
id 'com.gradleup.shadow' version '@version@'
id 'java'
}

Expand Down
Loading