Skip to content

Commit

Permalink
Improve github build infra (#18)
Browse files Browse the repository at this point in the history
Make github action that should produce installable repos
  • Loading branch information
alanocallaghan authored Mar 18, 2024
1 parent 778f027 commit b2b19bd
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 75 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/github_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Make draft release

on:
workflow_dispatch:

jobs:
jpackage:
name: Run JPackage
uses: ./.github/workflows/jpackage.yml

release:
needs: jpackage
permissions:
contents: write
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v4

- uses: actions/download-artifact@v4

- name: Release
env:
GH_TOKEN: ${{ github.token }}
run: gh release create --draft ${{ github.ref_name }} --title ${{ github.ref_name }} build/*.jar
42 changes: 0 additions & 42 deletions .github/workflows/gradle.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/jpackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Java CI with Gradle

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
workflow_call:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v4

- name: Set up JDK 17 # TODO: check Java version
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v2

- name: Build with Gradle
uses: gradle/gradle-build-action@v3
with:
arguments: build

- uses: actions/upload-artifact@v4
with:
path: build/libs/*.jar
name: build
retention-days: 7
33 changes: 0 additions & 33 deletions .github/workflows/release.yml

This file was deleted.

28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,34 @@ Add a license file to your GitHub repo so that others know what they can and can
This should be compatible with QuPath's license -- see https://github.com/qupath/qupath
## Repository configuration
### Easy install
If you follow some conventions in naming your extension and making releases, then other QuPath users will find it easy to automatically
install and update your extension!
First, we suggest you name your extension `qupath-extension-[something]`, and keep it in its own repository (named the same as the extension),
separate from other projects.
Next, when you want to publish a new version of your extension, use the `github_release.yml` workflow included in this repository.
To do so, you'd need to navigate to `Actions -> Make draft release -> Run workflow -> Run workflow` as shown in the following screenshot:
![Screenshot from 2024-03-14 18-44-42](https://github.com/alanocallaghan/qupath-extension-template/assets/10779688/4712a209-eda7-4f80-8bed-bbab20e4f50a)
This will automatically build the extension, and create a draft release containing the extension jar (and its associated sources and javadoc).
You can then navigate to `Releases` and fill out information about the release --- the version, any significant changes, etc.
Once published, users will be able to automatically install the extension as described here:
https://qupath.readthedocs.io/en/0.5/docs/intro/extensions.html#installing-extensions
### Automatic updates
To enable easy installation and automatic updates in QuPath, fill in the (**public**) GitHub owner and repository
for the extension.
https://github.com/qupath/qupath-extension-template/blob/778f02759d8a7fe5c73f1751edd58b6494beff9f/src/main/java/qupath/ext/template/DemoExtension.java#L65-L66
### Replace this readme
Don't forget to replace the contents of this readme with your own!
Expand Down

0 comments on commit b2b19bd

Please sign in to comment.