Skip to content

Commit

Permalink
build: new marketplace release process (#643)
Browse files Browse the repository at this point in the history
added the download and sonarcloud URL to the pull request, disabled the
forum post
updated the release procedure, fixed a typo
  • Loading branch information
gtoison authored Aug 28, 2022
1 parent 2a7eda9 commit db9618f
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
changelog-url: https://github.com/spotbugs/sonar-findbugs/releases/tag/4.1.0
download-url: https://repo.maven.apache.org/maven2/com/github/spotbugs/sonar-findbugs-plugin/4.1.0/sonar-findbugs-plugin-4.1.0.jar
public-version: 4.1.0
sonar-cloud-url: https://sonarcloud.io/summary/new_code?id=com.github.spotbugs:sonar-findbugs-plugin
github-token: ${{ secrets.PAT_TO_FORK }}
skip-creating-pull-request: true
- uses: actions/upload-artifact@v2
Expand Down
10 changes: 6 additions & 4 deletions .github/actions/sonar-update-center/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/actions/sonar-update-center/dist/index.js.map

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion .github/actions/sonar-update-center/src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,18 @@ export async function createPullRequest(
owner: string,
branch: string,
releaseName: string,
downloadUrl: string,
sonarCloudUrl: string,
changelogUrl: string
): Promise<{pr_number: number; html_url: string}> {
const octokit = getOctokit(token)
const title = `Release ${releaseName}`
const body = `We've released [${releaseName}](${encodeURI(
changelogUrl
)}), please add it to the marketplace.
I'll post to the forum and add its URL here later.
Detailed changelog: ${encodeURI(changelogUrl)}
Download URL: ${encodeURI(downloadUrl)}
SonarCloud: ${encodeURI(sonarCloudUrl)}
Thanks in advance!`
const result = await octokit.rest.pulls.create({
Expand Down
4 changes: 3 additions & 1 deletion .github/actions/sonar-update-center/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ async function run(): Promise<void> {
const latestSupportedVersion = core.getInput('latest-supported-sq-version')
const changelogUrl = core.getInput('changelog-url', {required: true})
const downloadUrl = core.getInput('download-url', {required: true})
const sonarCloudUrl = core.getInput('sonar-cloud-url', {required: true})
const publicVersion = core.getInput('public-version', {required: true})
if (!publicVersion || publicVersion.includes(',')) {
throw new Error(`Unsupproted publicVersion found: ${publicVersion}`)
Expand Down Expand Up @@ -114,10 +115,11 @@ async function run(): Promise<void> {
forked.owner,
branch,
`${mavenArtifactId} ${publicVersion}`,
downloadUrl,
sonarCloudUrl,
changelogUrl
)
core.info(`Draft PR has been created, visit ${html_url} to review.`)
const sonarCloudUrl = core.getInput('sonar-cloud-url', {required: true})
const announceBody = `Hi,
We are announcing new ${mavenArtifactId} ${publicVersion}.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ jobs:
github-token: ${{ secrets.PAT_TO_FORK }}
discourse-api-key: ${{ secrets.DISCOURSE_API_KEY }}
skip-creating-pull-request: false
skip-announcing: false
skip-announcing: true
1 change: 1 addition & 0 deletions .github/workflows/sonar-update-center.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
minimal-supported-sq-version: 7.9
changelog-url: https://github.com/spotbugs/sonar-findbugs/releases/tag/4.1.0
download-url: https://repo.maven.apache.org/maven2/com/github/spotbugs/sonar-findbugs-plugin/4.1.0/sonar-findbugs-plugin-4.1.0.jar
sonar-cloud-url: https://sonarcloud.io/summary/new_code?id=com.github.spotbugs:sonar-findbugs-plugin
public-version: 4.1.0
github-token: ${{ secrets.PAT_TO_FORK }}
skip-creating-pull-request: true
Expand Down
4 changes: 2 additions & 2 deletions RELEASE_PROCEDURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ When you release fixed version of SonarQube SpotBugs Plugin, please follow these
git checkout -b master-release
```

* Make sure profile XMLs are updated. See [`generate_progiles/README.md`](generate_progiles/README.md) for detail.
* Make sure profile XMLs are updated. See [`generate_profiles/README.md`](generate_profiles/README.md) for detail.

* change version number in `pom.xml` to stable version (e.g. `1.2.3`), then commit changes

Expand All @@ -32,4 +32,4 @@ Check [Sonatype official page](http://central.sonatype.org/pages/apache-maven.ht

## Release to SonarQube Marketplace

[sonar-update-center-action](https://github.com/KengoTODA/sonar-update-center-action/) will handle necessary procedures. Please confirm that the PR is made in [SonarSource/sonar-update-center-properties](https://github.com/SonarSource/sonar-update-center-properties/), and a topic is posted to [the community forum](https://community.sonarsource.com/c/plugins).
[sonar-update-center-action](https://github.com/KengoTODA/sonar-update-center-action/) will handle necessary procedures. Please confirm that the PR is made in [SonarSource/sonar-update-center-properties](https://github.com/SonarSource/sonar-update-center-properties/).

0 comments on commit db9618f

Please sign in to comment.