Skip to content

Commit

Permalink
build: Update announcements for next release
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmiray committed Oct 27, 2022
1 parent 2d24abb commit 9ff921c
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Expand Up @@ -161,6 +161,9 @@ jobs:
JRELEASER_TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
JRELEASER_TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
JRELEASER_TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
JRELEASER_HTTP_NOTICEABLE_PASSWORD: ${{ secrets.NOTICEABLE_APIKEY }}
NOTICEABLE_AUTHOR_EMAIL: ${{ secrets.NOTICEABLE_AUTHOR_EMAIL }}
NOTICEABLE_PROJECTID: ${{ secrets.NOTICEABLE_PROJECTID }}

- name: JReleaser release output
if: always()
Expand All @@ -185,6 +188,9 @@ jobs:

- name: Commit
run: |
git merge development
sed -i -e "s/^\version\:\ early-access.*/version: latest/g" docs/antora.yml
sed -i -e "s/jreleaser-version\:\ .*/jreleaser-version: ${{ needs.precheck.outputs.VERSION }}/g" docs/antora.yml
VERSION=${{ needs.precheck.outputs.VERSION }}
echo ${{ needs.precheck.outputs.VERSION }} > VERSION
git add VERSION
Expand Down
Expand Up @@ -35,6 +35,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.EnumSet;
Expand All @@ -56,6 +57,7 @@ public void apply(Map<String, Object> context) {
now = ZonedDateTime.now();
}
context.put("f_now", new TimeFormatFunction(now));
context.put("f_now_gmt", new TimeFormatFunction(now.withZoneSameInstant(ZoneId.of("GMT"))));

context.put("f_trim", new TrimFunction());
context.put("f_underscore", new UnderscoreFunction());
Expand Down
10 changes: 10 additions & 0 deletions jreleaser.yml
Expand Up @@ -119,6 +119,16 @@ announce:
twitter:
active: release
statusTemplate: src/jreleaser/twitter.tpl
http:
noticeable:
active: release
url: https://api.noticeable.io/graphql
authorization: bearer
bearerKeyword: Apikey
method: POST
headers:
Accept: application/json
Content-Type: application/json

assemble:
jlink:
Expand Down
Expand Up @@ -87,6 +87,7 @@ public void announce(org.jreleaser.model.internal.announce.HttpAnnouncer announc

String resolvedUrl = announcer.getResolvedUrl(context);
context.getLogger().info("url: {}", resolvedUrl);
context.getLogger().debug("payload: {}", payload);

if (context.isDryrun()) return;

Expand Down
22 changes: 22 additions & 0 deletions src/jreleaser/templates/http/noticeable.tpl
@@ -0,0 +1,22 @@
{"query":{{#f_json}}mutation {
createPost(
input: {
projectId: "{{ Env.NOTICEABLE_PROJECTID }}"
author: { fullName: "Andres Almiray", email: "{{ Env.NOTICEABLE_AUTHOR_EMAIL}}", avatar: "{{#f_escape_json}}https://firebasestorage.googleapis.com/v0/b/noticeable-service.appspot.com/o/users%2FH430BACfO4PbfXfiCqVEQems6gq2%2Favatars%2F70zOSc8WQijyhbzMYB9r?alt=media&token=522ba931-7bd3-4581-a15e-fe12d32aaee3{{/f_escape_json}}" }
content: "{{#f_escape_json}}{{#f_recursive_eval}}{{#f_file_read}}{{basedir}}/src/jreleaser/templates/http/noticeable_announcement.tpl{{/f_file_read}}{{/f_recursive_eval}}{{/f_escape_json}}"
forwardToWebhooks: false
isDraft: false
labels: [
{ name: "New", slug: "new", textColor: "#ffffff", backgroundColor: "#f3322f" },
{ name: "Announcement", slug: "announcement", textColor: "#ffffff", backgroundColor: "#6b6cf3" }
]
publicationTime: "{{#f_now_gmt}}yyyy-MM-dd'T'hh:mm:ss'Z'{{/f_now_gmt}}"
title: "{{releaseName}}"
}
) {
post {
id
permalink
}
}
}{{/f_json}}}
13 changes: 13 additions & 0 deletions src/jreleaser/templates/http/noticeable_announcement.tpl
@@ -0,0 +1,13 @@
JReleaser {{projectVersion}} is now available! This release adds the much awaited publication to Maven Central feature, and much more.

**Deploy:** New [deploy]({{projectLinkDocumentation}}/configuration/deploy.html) step lets you deploy JARs & POMs to: Sonatype Nexus2, JFrog Artifactory, Github Packages, Gitlab Packages, Gitea Packages. You may also deploy to Maven Central using the Nexus2 deployer.

**Extensions:** Extensions are finally available! [Extensions]({{projectLinkDocumentation}}/configuration/extensions.html) let you further customize how releases are handled.

**Release:** Apply milestone, label, and post a comment on all matching [issues]({{projectLinkDocumentation}}/configuration/release/github.html#_issues) belonging to a release.

**Announce:** New generic [HTTP announcer]({{projectLinkDocumentation}}/configuration/announce/http.html), useful with XWiki, Confluence, and other services.

**Templates:** Additional [template functions]({{projectLinkDocumentation}}/configuration/name-templates.html#_functions) such as json formatting and text processing.

[🚀Changelog](https://github.com/jreleaser/jreleaser/releases/tag/{{tagName}})
16 changes: 7 additions & 9 deletions src/jreleaser/twitter.tpl
@@ -1,12 +1,10 @@
🚀 JReleaser {{projectVersion}} has been released! {{releaseNotesUrl}}
🪝 Execution hooks for external commands before/after each execution step {{projectLinkDocumentation}}/configuration/hooks/command.html
🐦 Twitter announcer now supports threaded messages {{projectLinkDocumentation}}/configuration/announce/twitter.html
📦 asdf-vm as packager {{projectLinkDocumentation}}/configuration/packagers/asdf.html
📦 AppImage as packager {{projectLinkDocumentation}}/configuration/packagers/appimage.html
📦 Flatpak as packager {{projectLinkDocumentation}}/configuration/packagers/flatpak.html
⬆️ Upload binaries to @giteaio packages {{projectLinkDocumentation}}/configuration/upload/gitea.html
⬆️ Upload binaries to @gitlab packages {{projectLinkDocumentation}}/configuration/upload/gitlab.html
🗒 Additional template functions such as markdown2HTML and checksums {{projectLinkDocumentation}}/configuration/name-templates.html#_functions
🗂 Overwrite existing release assets when updating a release (only on @github & @giteaio)
📦 New deploy step lets you deploy JARs & POMs to: @sonatype Nexus2, @JFrog Artifactory, @github Packages, @gitlab Packages, @giteaio Packages {{projectLinkDocumentation}}/configuration/deploy.html
📦 The Nexus2 deployer may be used to publish JARs & POMs to Maven Central. JReleaser can verify many of Maven Central's rules before any artifacts are deployed.
🌟 Custom extensions are finally available! Extensions let you further customize how releases are handled {{projectLinkDocumentation}}/configuration/extensions.html
📝 Apply milestone, label, and post a comment on all matching issues belonging to a release {{projectLinkDocumentation}}/configuration/release/github.html#_issues
📣 Added a generic HTTP announcer, useful with @xwiki, @Confluence, and other services {{projectLinkDocumentation}}/configuration/announce/http.html
💻 Additional configuration flags supported in auto-config releases, such as --copyright and --author
🗒 Additional template functions such as json formatting and text processing {{projectLinkDocumentation}}/configuration/name-templates.html#_functions
📝 Full list of changes available at the {{milestoneName}} milestone {{projectLinkVcsBrowser}}/milestones?state=closed
🙏 As always, feedback is welcome. Feel free to raise a ticket at {{issueTrackerUrl}}

0 comments on commit 9ff921c

Please sign in to comment.