Skip to content

Commit

Permalink
chore: working on releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
kmruiz committed May 8, 2024
1 parent ceec954 commit 48c9541
Show file tree
Hide file tree
Showing 8 changed files with 161 additions and 46 deletions.
20 changes: 20 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--
^^^^^
Please fill the title above according to https://www.conventionalcommits.org/en/v1.0.0/.
type(scope): message <TICKET-NUMBER-IF-ANY>
eg. fix(type-hint): infer type of a constant for type checking INTELLIJ-1111
-->
## Description
<!--- Describe your changes in detail so reviewers have enough content on what this PR aims to achieve -->
<!--- If applicable, describe (or illustrate) architecture flow -->

### Checklist
- [ ] New tests and/or benchmarks are included.
- [ ] Documentation is changed or added.
- [ ] Changelog is updated accordingly.
- [ ] I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement).

## Open Questions
<!--- Any particular areas you'd like reviewers to pay attention to? -->
31 changes: 22 additions & 9 deletions .github/workflows/draft-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,17 @@ jobs:
run: |
./gradlew --quiet --console=plain "unit-test" ":packages:jetbrains-plugin:test"
- name: Patch Plugin XML
run: |
./gradlew ":packages:jetbrains-plugin:patchPluginXml"
- name: Verify Plugin
run: |
./gradlew ":packages:jetbrains-plugin:runPluginVerifier"
- name: Generate SBOM
- name: Patch Changelog
run: |
./gradlew ":packages:jetbrains-plugin:cyclonedxBom"
- uses: actions/upload-artifact@v4
name: Upload SBOM
with:
name: sbom
path: "build/reports/cyclonedx-sbom.json"
./gradlew ":packages:jetbrains-plugin:patchChangelog"
- name: Create Draft Release
shell: bash
Expand All @@ -103,5 +101,20 @@ jobs:
run: |
set -e
echo Creating draft release for: "${RELEASE_TAG}"
echo We will do something here at some point
git add .
git commit --no-verify -m "Commit to hold release ${RELEASE_TAG}"
git push origin ${RELEASE_TAG}
GIT_HASH=$(git rev-parse HEAD)
ls packages/jetbrains-plugin/build/distributions/jetbrains-plugin.zip
CHANGELOG=$(./gradlew --quiet --console=plain :packages:jetbrains-plugin:getChangelog)
gh release create "${RELEASE_TAG}" \
--title "${RELEASE_TAG}" \
--notes "${CHANGELOG}" \
--target ${GIT_HASH} \
--draft \
packages/jetbrains-plugin/build/distributions/jetbrains-plugin.zip

37 changes: 37 additions & 0 deletions .github/workflows/publish-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish Release

on:
release:
types: [published]

jobs:
prepare-release:
name: "Prepare Release"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
fetch-depth: 0
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'
cache: 'gradle'


- name: Publish into JetBrains Marketplace
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
git checkout main
git merge ${{ github.ref_name }}
git push origin main
# Do Release
22 changes: 0 additions & 22 deletions .github/workflows/quality-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,27 +73,6 @@ jobs:
with:
name: unit-test-coverage
path: "**/build/reports/jacoco/test/jacocoTestReport.xml"

cyclonedx-sbom-generation:
name: 'SBOM Generation'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'
cache: 'gradle'
- name: SBOM Generation
run: |
./gradlew --quiet --console=plain ":packages:jetbrains-plugin:cyclonedxBom"
- uses: actions/upload-artifact@v4
name: Upload SBOM
with:
name: sbom
path: "build/reports/cyclonedx-sbom.json"

functional-tests:
name: 'Functional & UI Tests'
Expand All @@ -102,7 +81,6 @@ jobs:
- catalog-check
- style-check
- unit-tests
- cyclonedx-sbom-generation
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ MongoDB Plugin that does a lot of features. This is markdown.
### Fixed

### Security

## [0.0.1] - 2024-05-08

### Added

- Something Added
76 changes: 76 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
3 changes: 0 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ versions-plugin="0.51.0"
spotless-plugin="6.25.0"
jmh-plugin="0.7.2"
diktat-plugin="1.0.1"
cyclonedx-plugin="1.8.2"
jmhreport-plugin="0.9.0"
# Library dependencies
bson="5.0.0"
Expand All @@ -31,7 +30,6 @@ intellij={ id="org.jetbrains.intellij", version.ref="intellij-plugin" }
jmh={ id="me.champeau.jmh", version.ref="jmh-plugin" }
versions={ id="com.github.ben-manes.versions", version.ref="versions-plugin" }
spotless={ id="com.diffplug.spotless", version.ref="spotless-plugin" }
cyclonedx={ id="org.cyclonedx.bom", version.ref="cyclonedx-plugin" }
changelog={ id="org.jetbrains.changelog", version.ref="intellij-changelog-plugin" }
jmhreport={ id="io.morethan.jmhreport", version.ref="jmhreport-plugin" }
[libraries]
Expand Down Expand Up @@ -63,4 +61,3 @@ testing-jmh-generatorByteCode={ group="org.openjdk.jmh", name="jmh-generator-byt
buildScript-plugin-kotlin={ group="org.jetbrains.kotlin", name="kotlin-gradle-plugin", version="1.9.23" }
buildScript-plugin-versions={ group="com.github.ben-manes", name="gradle-versions-plugin", version.ref="versions-plugin" }
buildScript-plugin-spotless={ group="com.diffplug.spotless", name="spotless-plugin-gradle", version="6.25.0" }
buildScript-plugin-cyclonedx={ group="org.cyclonedx", name="cyclonedx-gradle-plugin", version.ref="cyclonedx-plugin" }
12 changes: 0 additions & 12 deletions packages/jetbrains-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import org.cyclonedx.gradle.CycloneDxTask
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.date

Expand All @@ -12,7 +11,6 @@ plugins {
alias(libs.plugins.jmh)
alias(libs.plugins.jmhreport)
alias(libs.plugins.changelog)
alias(libs.plugins.cyclonedx)
}

intellij {
Expand All @@ -22,16 +20,6 @@ intellij {
plugins.set(listOf("com.intellij.java", "com.intellij.database"))
}

tasks.named<CycloneDxTask>("cyclonedxBom").configure {
setIncludeConfigs(listOf("compileClasspath"))
setProjectType("application")
setSchemaVersion("1.5")
setDestination(project.file("build/reports"))
setOutputName("cyclonedx-sbom")
setOutputFormat("json")
setIncludeLicenseText(true)
}

dependencies {
implementation(project(":packages:mongodb-access-adapter"))
implementation(project(":packages:mongodb-autocomplete-engine"))
Expand Down

0 comments on commit 48c9541

Please sign in to comment.