Skip to content

Commit b36ead2

Browse files
authored
Merge pull request #16 from BEAST2-Dev/beast3
Beast3
2 parents 6b96321 + 1837117 commit b36ead2

61 files changed

Lines changed: 1397 additions & 659 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci-publish.yml‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CI & Publish
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
tags: [ 'v*' ]
7+
pull_request:
8+
branches: [ master ]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up JDK 25 (Azul Zulu)
19+
if: "!startsWith(github.ref, 'refs/tags/v')"
20+
uses: actions/setup-java@v4
21+
with:
22+
distribution: zulu
23+
java-version: '25'
24+
cache: maven
25+
26+
- name: Set up JDK 25 (Azul Zulu) for Maven Central
27+
if: startsWith(github.ref, 'refs/tags/v')
28+
uses: actions/setup-java@v4
29+
with:
30+
distribution: zulu
31+
java-version: '25'
32+
cache: maven
33+
server-id: central
34+
server-username: CENTRAL_USERNAME
35+
server-password: CENTRAL_TOKEN
36+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
37+
gpg-passphrase: GPG_PASSPHRASE
38+
39+
- name: Set release version from tag
40+
if: startsWith(github.ref, 'refs/tags/v')
41+
run: |
42+
VERSION=${GITHUB_REF_NAME#v}
43+
echo "Publishing version: $VERSION"
44+
mvn versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false
45+
46+
- name: Build and test
47+
run: mvn verify
48+
49+
- name: Publish to Maven Central
50+
if: startsWith(github.ref, 'refs/tags/v')
51+
run: mvn deploy -Prelease -DskipTests
52+
env:
53+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
54+
CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}
55+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

‎README.md‎

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,106 @@ Select models through path sampling/stepping stone analysis
77
[Path sampling](http://www.beast2.org/path-sampling/)
88

99
[Path sampling with a GUI](http://www.beast2.org/2014/07/14/path-sampling-with-a-gui.html)
10+
11+
## For developer
12+
13+
Build the package, skipping tests:
14+
15+
```bash
16+
mvn clean package -DskipTests
17+
```
18+
19+
Run an example XML through BEAST:
20+
21+
```bash
22+
mvn exec:exec -Dbeast.args="src/test/resources/modelselection/examples/normalTest-1.xml"
23+
```
24+
### Project folder structure
25+
26+
BEAUti templates and the example XMLs live under `src/`, not root directory:
27+
28+
```
29+
src/
30+
├── main/resources/modelselection/
31+
│ ├── app/tools/ps.png
32+
│ └── fxtemplates/
33+
│ └── ModelSelection.xml
34+
└── test/resources/modelselection/examples/
35+
├── normalTest-1.xml, normalTest-2.xml, normalTestPS-1.xml, normalTestPS-2.xml,
36+
│ testPairedPathSampler.xml, testPathSampler.xml, testPathSamplerForSimpleTree.xml
37+
└── legacy/ (superseded example XMLs, excluded from the release ZIP)
38+
```
39+
40+
`fxtemplates/` is a **main** resource, so it's bundled into the jar (see below).
41+
`examples/` is a **test** resource, so the assembly plugin copies it into the ZIP's
42+
top-level `/examples/` directly from `src/test/resources/`, excluding `legacy/**`
43+
(see `src/assembly/beast-package.xml`).
44+
45+
46+
## Releasing
47+
48+
### Jar folder structure
49+
50+
The release module jar, bundled into the BEAST package ZIP's `lib/`, contains:
51+
52+
```
53+
META-INF/
54+
├── MANIFEST.MF
55+
└── maven/io.github.beast2-dev/model-selection/
56+
├── pom.xml
57+
└── pom.properties
58+
modelselection/
59+
├── app/tools/ (PathSampler, PathSampleAnalyser, PairedPathSampler*, GeneralisedSteppingStone, ps.png)
60+
├── core/ (CPOLogger)
61+
├── cpo/ (CPOAnalyser, BEASTRunAnalyser + inner classes)
62+
├── fxtemplates/
63+
│ └── ModelSelection.xml
64+
├── gss/ (GeneralisedSteppingStone*, MCMC2GSS, MCMC2IS, GSSFromFile, TraceLog, ...)
65+
│ ├── coalescent/
66+
│ └── distribution/
67+
└── inference/ (PathSampler, PathSamplingStep, PairedPathSampler*, AICMAnalyser, DiffLogger, ...)
68+
version.xml
69+
module-info.class
70+
```
71+
72+
`modelselection/fxtemplates/ModelSelection.xml` is loaded via module path resource
73+
lookup at runtime — `src/assembly/beast-package.xml` does not copy it anywhere else in
74+
the ZIP.
75+
76+
### 1. Maven Central release (JARs)
77+
78+
Push a `v*` tag to trigger `.github/workflows/ci-publish.yml`, which sets the Maven
79+
version from the tag, builds, tests, GPG-signs, and publishes to Maven Central:
80+
81+
```bash
82+
git tag v1.7.0
83+
git push origin v1.7.0
84+
```
85+
86+
Monitor the run at:
87+
https://github.com/BEAST2-Dev/model-selection/actions/workflows/ci-publish.yml
88+
89+
### 2. GitHub release (BEAST package ZIP)
90+
91+
First remove `-SNAPSHOT` from `<version>` in `pom.xml` so it matches the release
92+
(e.g. `1.7.0-SNAPSHOT` -> `1.7.0`), then build the installable BEAST package ZIP locally:
93+
94+
```bash
95+
mvn clean package -DskipTests
96+
```
97+
98+
**Note:** if you skip the manual edit above, the build still succeeds, but the module
99+
jar bundled inside the ZIP (`lib/model-selection-<version>.jar`) will carry the
100+
`-SNAPSHOT` suffix — that's meant for dev/testing builds, not an official release.
101+
Alternatively, instead of hand-editing `pom.xml`, run:
102+
103+
```bash
104+
mvn versions:set -DnewVersion=<version> -DgenerateBackupPoms=false
105+
```
106+
107+
The ZIP is written to `target/MODEL_SELECTION.v<version>.zip`. Then manually:
108+
109+
1. Go to https://github.com/BEAST2-Dev/model-selection/releases/new
110+
2. Choose the matching tag (e.g. `v1.7.0`), fill in the release title/notes
111+
3. Upload `target/MODEL_SELECTION.v<version>.zip` as a release asset
112+
4. Publish

0 commit comments

Comments
 (0)