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

feat: initial implementation #3

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 0 additions & 12 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,6 @@ body:
description: Linux or Windows
validations:
required: true
- type: input
attributes:
label: Polarion version
description: 2310, 2404, etc...
validations:
required: true
- type: input
attributes:
label: Extension Version
description: It can be found under https://<<host>>/polarion/#/project/dev/administration/<<Extension Name>>/About
validations:
required: true
- type: textarea
attributes:
label: Anything else
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Feature request
description: Request an enhancement for this Polarion extension
description: Request an enhancement for this maven plugin
labels: [enhancement]
body:
- type: markdown
Expand Down
25 changes: 3 additions & 22 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
permissions:
contents: read
packages: write
env:
GITHUB_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up JDK and Maven
Expand All @@ -20,25 +22,8 @@ jobs:
gpg-private-key: ${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_GPG_PRIVATE_KEY }}
- uses: whelk-io/maven-settings-xml-action@9dc09b23833fa9aa7f27b63db287951856f3433d # v22
with:
repositories: >
[
{
"id": "s3",
"name": "s3.sbb.polarion.maven.repo",
"url": "s3://sbb-polarion-maven-repo/polarion.mvn",
"releases": {
"enabled": "true",
"updatePolicy": "never"
}
}
]
servers: >
[
{
"id": "s3",
"username": "${{ secrets.S3_SBB_POLARION_MAVEN_REPO_RW_ACCESS_KEY }}",
"password": "${{ secrets.S3_SBB_POLARION_MAVEN_REPO_RW_SECRET_ACCESS_KEY }}"
},
{
"id": "github",
"username": "${env.GITHUB_ACTOR}",
Expand Down Expand Up @@ -68,16 +53,12 @@ jobs:
run: cat /home/runner/.m2/settings.xml
- name: Build with Maven
run: mvn --batch-mode clean package
env:
FAIL_ON_CHECK_COMMANDS: 'true'
- name: Extract artefact version
id: artefact_version
run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
- name: Publish to Maven Central
if: ${{ !endsWith(steps.artefact_version.outputs.version, '-SNAPSHOT') && github.ref == 'refs/heads/main' }}
run: mvn --batch-mode deploy -P gpg-sign -P nexus-staging -Dnexus-staging-maven-plugin.autoReleaseAfterClose=false
run: mvn --batch-mode deploy -P gpg-sign -P nexus-staging
- name: Publish to GitHub Packages
if: ${{ !endsWith(steps.artefact_version.outputs.version, '-SNAPSHOT') && github.ref == 'refs/heads/main' }}
run: mvn --batch-mode deploy -P gpg-sign -P deploy-github-packages
env:
GITHUB_TOKEN: ${{ github.token }}
7 changes: 0 additions & 7 deletions .mvn/extensions.xml

This file was deleted.

11 changes: 0 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,9 @@ These are mostly guidelines, not rules. Use your best judgment, and feel free to
## <a id="prerequisites"></a>Prerequisites
This project and everyone participating in it are governed by our [Code of Conduct](https://github.com/SchweizerischeBundesbahnen/.github/blob/main/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.

All contributors must have an active Polarion license. An active Polarion license means that the contributor has access to a valid Polarion license issued by Siemens, including but not limited to customer, partner, academic, trial, or demo Polarion license.

## <a id="asking-questions"></a>Asking questions
Do not know how something in this project works? Curious if this project can achieve your desired functionality? Please ask questions in this project discussions [here](../../discussions)

## <a id="what-should-i-know-before-i-get-started"></a>What should I know before I get started?

### <a id="tools-and-packages"></a>Tools and Packages
All extensions provided by SBB Polarion Team can be built, tested and packaged using Maven.
It is only possible when the dependencies are extract from Polarion installer. The process must be performed by each contributor. Please consider to use https://github.com/SchweizerischeBundesbahnen/polarion-artifacts-deployer to extract the dependencies for your own Polarion installer version.

### <a id="design-decisions"></a>Design Decisions
The generic implementation for extensions provided by SBB Polarion Team is located in [ch.sbb.polarion.extension.generic](https://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.generic)

## <a id="how-can-i-contribute"></a>How Can I Contribute?

### <a id="reporting-bugs"></a>Reporting Bugs
Expand Down
57 changes: 31 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,41 @@
# Polarion ALM extension to <...>
# Markdown to HTML Maven Plugin

This Maven plugin uses GitHub API for converting Markdown to HTML.

This Polarion extension provides possibility to <...>
## Build

This extension can be produced using maven:
```bash
mvn clean package
```

## Installation to Polarion

To install the extension to Polarion `ch.sbb.polarion.extension.<extension_name>-<version>.jar`
should be copied to `<polarion_home>/polarion/extensions/ch.sbb.polarion.extension.<extension_name>/eclipse/plugins`
It can be done manually or automated using maven build:
```bash
mvn clean install -P install-to-local-polarion
```
For automated installation with maven env variable `POLARION_HOME` should be defined and point to folder where Polarion is installed.

Changes only take effect after restart of Polarion.

## Polarion configuration

<...>


## Extension Configuration

<...>


## Usage

<...>

This plugin can be used in a maven project by adding the following to the `pom.xml`:

```xml
<build>
<plugins>
<plugin>
<groupId>ch.sbb</groupId>
<artifactId>markdown2html-maven-plugin</artifactId>
<version>${markdown2html-maven-plugin.version}</version>
<executions>
<execution>
<id>readme.md-to-about.html</id>
<phase>generate-resources</phase>
<goals>
<goal>convert</goal>
</goals>
</execution>
</executions>
<configuration>
<inputFile>${project.basedir}/README.md</inputFile>
<outputFile>${project.basedir}/README.html</outputFile>
<tokenEnvVarName>GITHUB_TOKEN</tokenEnvVarName>
</configuration>
</plugin>
...
</plugins>
</build>
```
4 changes: 4 additions & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# tells Lombok that this is the root directory and that it shouldn’t search parent directories for more configuration files
config.stopBubbling = true
# tells Lombok to add @lombok.Generated annotation to all generated methods
lombok.addLombokGeneratedAnnotation = true
Loading
Loading