docs: add AGENTS.md with Cursor Cloud dev environment instructions (#69) #46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Plugin | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| name: Publish plugin to Nextflow registry | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: write | |
| actions: write | |
| attestations: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| fetch-depth: 0 # Need full history to check for existing tags | |
| - name: Setup Java 17 | |
| uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 | |
| with: | |
| java-version: 17 | |
| architecture: x64 | |
| distribution: "temurin" | |
| - name: Extract version from build.gradle | |
| id: get_version | |
| run: | | |
| VERSION=$(grep "^version = " build.gradle | sed "s/version = '\(.*\)'/\1/") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "tag=v$VERSION" >> $GITHUB_OUTPUT | |
| echo "Detected version: $VERSION" | |
| - name: Check if release already exists | |
| id: check_release | |
| run: | | |
| if git rev-parse "v${{ steps.get_version.outputs.version }}" >/dev/null 2>&1; then | |
| echo "exists=true" >> $GITHUB_OUTPUT | |
| echo "Tag v${{ steps.get_version.outputs.version }} already exists, skipping release" | |
| else | |
| echo "exists=false" >> $GITHUB_OUTPUT | |
| echo "Tag v${{ steps.get_version.outputs.version }} does not exist, proceeding with release" | |
| fi | |
| - name: Publish plugin to registry | |
| if: steps.check_release.outputs.exists == 'false' | |
| run: make release | |
| env: | |
| GRADLE_OPTS: "-Dorg.gradle.daemon=false" | |
| NPR_API_KEY: ${{ secrets.NF_PLUGIN_PUBLISH_TOKEN }} | |
| - name: Extract changelog for version | |
| if: steps.check_release.outputs.exists == 'false' | |
| id: changelog | |
| run: | | |
| VERSION="${{ steps.get_version.outputs.version }}" | |
| # Extract changelog section for this version | |
| if [ -f CHANGELOG.md ]; then | |
| # Try to extract section between ## [version] and next ## heading | |
| CHANGELOG=$(sed -n "/## \[${VERSION}\]/,/## \[/p" CHANGELOG.md | sed '$d' | tail -n +2) | |
| # If that didn't work, try without brackets | |
| if [ -z "$CHANGELOG" ]; then | |
| CHANGELOG=$(sed -n "/## ${VERSION}/,/## /p" CHANGELOG.md | sed '$d' | tail -n +2) | |
| fi | |
| # If still empty, use a default message | |
| if [ -z "$CHANGELOG" ]; then | |
| CHANGELOG="Release version ${VERSION}" | |
| fi | |
| else | |
| CHANGELOG="Release version ${VERSION}" | |
| fi | |
| # Save to file for gh release create | |
| echo "$CHANGELOG" > /tmp/changelog.txt | |
| echo "Changelog extracted for version $VERSION" | |
| - name: Create git tag and GitHub release | |
| if: steps.check_release.outputs.exists == 'false' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| TAG="${{ steps.get_version.outputs.tag }}" | |
| VERSION="${{ steps.get_version.outputs.version }}" | |
| # Configure git | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| # Create and push tag | |
| git tag -a "$TAG" -m "Release $VERSION" | |
| git push origin "$TAG" | |
| # Create GitHub release | |
| gh release create "$TAG" \ | |
| --title "Release $VERSION" \ | |
| --notes-file /tmp/changelog.txt | |
| - name: Release complete | |
| if: steps.check_release.outputs.exists == 'false' | |
| run: | | |
| echo "✅ Release ${{ steps.get_version.outputs.version }} completed successfully!" | |
| echo " - Plugin published to Nextflow registry" | |
| echo " - Git tag ${{ steps.get_version.outputs.tag }} created" | |
| echo " - GitHub release created" | |
| - name: Release skipped | |
| if: steps.check_release.outputs.exists == 'true' | |
| run: | | |
| echo "⏭️ Release ${{ steps.get_version.outputs.version }} already exists, skipping" |