Compare commits

...

4 Commits

Author SHA1 Message Date
Antonin Delpeuch
edc7910f3f
Merge e518b2fd8d into 8e04ddff28 2024-08-29 12:04:30 -07:00
mahabaleshwars
8e04ddff28
Update Error Messages and Fix Architecture Detection for IBM Semeru (#677)
* Updated Error message for Semuru

* Enhanced error message

* Added architecture to semeru

* updated code to provide aarch64 for arm64 architecture for semeru

* updated semver message

* updated semver error message

* Enhanced the error message for semeru

* Enhanced error messaged for semeru distribution

* enhanced error message for semeru
2024-08-29 13:48:24 -05:00
Antonin Delpeuch
e518b2fd8d
Remove unnecessary comment 2024-03-13 09:50:09 +01:00
Antonin Delpeuch
58d36cecb0
Update recommended configuration for GPG signing
This attempts to document the new recommended configuration to sign artifacts with the maven-gpg-plugin as part of the deploy process.

It imitates this PR from the maintainer of the maven-gpg-plugin:
https://github.com/xerial/sqlite-jdbc/pull/1082/files

Notes that this requires the maven-gpg-plugin version 3.2.0 or above, not sure if this is worth adding to the documentation as I expect this guide will mostly be followed by people setting up a new project (hopefully using the latest version of the plugin by default).

@cstamas I hope I got it right, feel free to suggest any improvements
2024-03-13 09:45:33 +01:00
4 changed files with 17 additions and 32 deletions

View File

@ -207,7 +207,7 @@ describe('findPackageForDownload', () => {
}); });
distribution['getAvailableVersions'] = async () => []; distribution['getAvailableVersions'] = async () => [];
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow( await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
`Unsupported architecture for IBM Semeru: ${arch}, the following are supported: x64, x86, ppc64le, ppc64, s390x, aarch64` `Unsupported architecture for IBM Semeru: ${arch} for your current OS version, the following are supported: x64, x86, ppc64le, ppc64, s390x, aarch64`
); );
} }
); );

9
dist/setup/index.js vendored
View File

@ -124939,8 +124939,9 @@ class SemeruDistribution extends base_installer_1.JavaBase {
} }
findPackageForDownload(version) { findPackageForDownload(version) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
if (!supportedArchitectures.includes(this.architecture)) { const arch = this.distributionArchitecture();
throw new Error(`Unsupported architecture for IBM Semeru: ${this.architecture}, the following are supported: ${supportedArchitectures.join(', ')}`); if (!supportedArchitectures.includes(arch)) {
throw new Error(`Unsupported architecture for IBM Semeru: ${this.architecture} for your current OS version, the following are supported: ${supportedArchitectures.join(', ')}`);
} }
if (!this.stable) { if (!this.stable) {
throw new Error('IBM Semeru does not provide builds for early access versions'); throw new Error('IBM Semeru does not provide builds for early access versions');
@ -124974,7 +124975,7 @@ class SemeruDistribution extends base_installer_1.JavaBase {
const availableOptionsMessage = availableOptions const availableOptionsMessage = availableOptions
? `\nAvailable versions: ${availableOptions}` ? `\nAvailable versions: ${availableOptions}`
: ''; : '';
throw new Error(`Could not find satisfied version for SemVer '${version}'. ${availableOptionsMessage}`); throw new Error(`Could not find satisfied version for SemVer version '${version}' for your current OS version for ${this.architecture} architecture ${availableOptionsMessage}`);
} }
return resolvedFullVersion; return resolvedFullVersion;
}); });
@ -124999,7 +125000,7 @@ class SemeruDistribution extends base_installer_1.JavaBase {
getAvailableVersions() { getAvailableVersions() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const platform = this.getPlatformOption(); const platform = this.getPlatformOption();
const arch = this.architecture; const arch = this.distributionArchitecture();
const imageType = this.packageType; const imageType = this.packageType;
const versionRange = encodeURI('[1.0,100.0]'); // retrieve all available versions const versionRange = encodeURI('[1.0,100.0]'); // retrieve all available versions
const releaseType = this.stable ? 'ga' : 'ea'; const releaseType = this.stable ? 'ga' : 'ea';

View File

@ -283,14 +283,13 @@ jobs:
server-id: maven # Value of the distributionManagement/repository/id field of the pom.xml server-id: maven # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Publish to Apache Maven Central - name: Publish to Apache Maven Central
run: mvn deploy run: mvn deploy -Dgpg.signer=bc
env: env:
MAVEN_USERNAME: maven_username123 MAVEN_USERNAME: maven_username123
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
``` ```
@ -326,10 +325,6 @@ The two `settings.xml` files created from the above example look like the follow
<username>${env.MAVEN_USERNAME}</username> <username>${env.MAVEN_USERNAME}</username>
<password>${env.MAVEN_CENTRAL_TOKEN}</password> <password>${env.MAVEN_CENTRAL_TOKEN}</password>
</server> </server>
<server>
<id>gpg.passphrase</id>
<passphrase>${env.MAVEN_GPG_PASSPHRASE}</passphrase>
</server>
</servers> </servers>
</settings> </settings>
``` ```
@ -338,21 +333,6 @@ The two `settings.xml` files created from the above example look like the follow
If you don't want to overwrite the `settings.xml` file, you can set `overwrite-settings: false` If you don't want to overwrite the `settings.xml` file, you can set `overwrite-settings: false`
### Extra setup for pom.xml:
The Maven GPG Plugin configuration in the pom.xml file should contain the following structure to avoid possible issues like `Inappropriate ioctl for device` or `gpg: signing failed: No such file or directory`:
```xml
<configuration>
<!-- Prevent gpg from using pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
```
GPG 2.1 requires `--pinentry-mode` to be set to `loopback` in order to pick up the `gpg.passphrase` value defined in Maven `settings.xml`.
### GPG ### GPG
If `gpg-private-key` input is provided, the private key will be written to a file in the runner's temp directory, the private key file will be imported into the GPG keychain, and then the file will be promptly removed before proceeding with the rest of the setup process. A cleanup step will remove the imported private key from the GPG keychain after the job completes regardless of the job status. This ensures that the private key is no longer accessible on self-hosted runners and cannot "leak" between jobs (hosted runners are always clean instances). If `gpg-private-key` input is provided, the private key will be written to a file in the runner's temp directory, the private key file will be imported into the GPG keychain, and then the file will be promptly removed before proceeding with the rest of the setup process. A cleanup step will remove the imported private key from the GPG keychain after the job completes regardless of the job status. This ensures that the private key is no longer accessible on self-hosted runners and cannot "leak" between jobs (hosted runners are always clean instances).

View File

@ -33,11 +33,15 @@ export class SemeruDistribution extends JavaBase {
protected async findPackageForDownload( protected async findPackageForDownload(
version: string version: string
): Promise<JavaDownloadRelease> { ): Promise<JavaDownloadRelease> {
if (!supportedArchitectures.includes(this.architecture)) { const arch = this.distributionArchitecture();
if (!supportedArchitectures.includes(arch)) {
throw new Error( throw new Error(
`Unsupported architecture for IBM Semeru: ${ `Unsupported architecture for IBM Semeru: ${
this.architecture this.architecture
}, the following are supported: ${supportedArchitectures.join(', ')}` } for your current OS version, the following are supported: ${supportedArchitectures.join(
', '
)}`
); );
} }
@ -81,7 +85,7 @@ export class SemeruDistribution extends JavaBase {
? `\nAvailable versions: ${availableOptions}` ? `\nAvailable versions: ${availableOptions}`
: ''; : '';
throw new Error( throw new Error(
`Could not find satisfied version for SemVer '${version}'. ${availableOptionsMessage}` `Could not find satisfied version for SemVer version '${version}' for your current OS version for ${this.architecture} architecture ${availableOptionsMessage}`
); );
} }
@ -124,7 +128,7 @@ export class SemeruDistribution extends JavaBase {
public async getAvailableVersions(): Promise<ISemeruAvailableVersions[]> { public async getAvailableVersions(): Promise<ISemeruAvailableVersions[]> {
const platform = this.getPlatformOption(); const platform = this.getPlatformOption();
const arch = this.architecture; const arch = this.distributionArchitecture();
const imageType = this.packageType; const imageType = this.packageType;
const versionRange = encodeURI('[1.0,100.0]'); // retrieve all available versions const versionRange = encodeURI('[1.0,100.0]'); // retrieve all available versions
const releaseType = this.stable ? 'ga' : 'ea'; const releaseType = this.stable ? 'ga' : 'ea';