Skip to content

Add nightly SNAPSHOT release to GitHub Packages #950

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

Merged
merged 8 commits into from
May 16, 2025
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
30 changes: 30 additions & 0 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Java SNAPSHOT Release

permissions:
packages: write

on:
workflow_dispatch:
push:
branches:
- master
schedule:
- cron: '0 1 * * *'

jobs:
release-snapshot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: maven

- name: Build and Publish SNAPSHOT
run: ./mvnw deploy -B -V -D"maven.javadoc.skip"="true" -D"java.util.logging.config.file"="${{github.workspace}}/quickfixj-core/src/test/resources/logging.properties" -D"http.keepAlive"="false" -D"maven.wagon.http.pool"="false" -D"maven.wagon.httpconnectionManager.ttlSeconds"="120"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,3 +320,71 @@ Many integrations require specialisation of the FIX Messages, Components and/or
![image info](./src/main/puml/custom_dependencies.png)

![image info](./src/main/puml/custom_dependencies_fixt11_fixlatest.png)

### Using SNAPSHOTs

The nightly SNAPSHOT releases are available on **GitHub Packages**.
GitHub Packages requires authentication - even for public repositories.
You need to use a [Personal Access Token (PAT)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)
with `read:packages` permission.

#### Maven Setup:

Add the authentication part to your `settings.xml` file in `servers`:

```xml
<!--settings.xml-->
<servers>
<server>
<id>github-quickfixj</id>
<username>USERNAME</username> <!-- Your GitHub username -->
<password>GITHUB_PAT</password> <!-- Your GitHub PAT -->
</server>
</servers>
```

Add the GitHub Packages repository in `repositories` and the desired `SNAPSHOT` version in `dependencies`:

```xml
<!--pom.xml-->
<repositories>
<repository>
<id>github-quickfixj</id>
<name>GitHub Packages for quickfixj</name>
<url>https://maven.pkg.github.com/quickfix-j/quickfixj</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>

<!-- other repositories-->
</repositories>


<dependencies>
<dependency>
<groupId>org.quickfixj</groupId>
<artifactId>quickfixj-all</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>

<!-- other dependencies-->
</dependencies>
```

#### Gradle Setup (groovy):

Add the following to your `build.gradle` file:

```groovy
//build.gradle
repositories {
maven {
url = uri("https://maven.pkg.github.com/quickfix-j/quickfixj")
credentials {
username = "USERNAME" // Your GitHub username
password = "GITHUB_PAT" // Your GitHub PAT
}
}
}
```
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,9 @@
</profiles>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<id>github</id>
<name>GitHub Packages - Snapshots</name>
<url>https://maven.pkg.github.com/quickfix-j/quickfixj</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
Expand Down