diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..858a36b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,77 @@ +name: release +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +permissions: + contents: write + +jobs: + build: + if: github.ref == 'refs/heads/master' + name: Build + runs-on: ubuntu-latest + timeout-minutes: 90 + strategy: + fail-fast: false + matrix: + java_version: [19] + + steps: + - name: Environment + run: env | sort + + - name: Checkout + uses: actions/checkout@v1 + with: + fetch-depth: 1 + submodules: true + + - name: Setup Java ${{ matrix.java_version }} + uses: actions/setup-java@v1 + with: + java-version: ${{matrix.java_version}} + architecture: x64 + + - name: Tests + run: ./gradlew check + env: + GRADLE_OPTS: '-Dorg.gradle.daemon=false' + + publish-gpr: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 19 for x64 + uses: actions/setup-java@v3 + with: + java-version: '19' + distribution: 'temurin' + architecture: x64 + - name: version + run: echo "::set-output name=version::$(./gradlew properties -q | awk '/^version:/ {print $2}')" + id: version + + - name: release + uses: actions/create-release@v1 + id: create_release + with: + draft: false + prerelease: false + release_name: ${{ steps.version.outputs.version }} + tag_name: ${{ github.ref }} + body_path: CHANGELOG.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: build artifacts + run: ./gradlew jsonPlugin + + - name: Upload artifact and release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + ./plugins/nf-nomad/build/plugin/* \ No newline at end of file diff --git a/README.md b/README.md index 1408aa7..0ea5abb 100644 --- a/README.md +++ b/README.md @@ -93,14 +93,16 @@ Follow these steps to package, upload and publish the plugin: 1. Create a file named `gradle.properties` in the project root containing the following attributes (this file should not be committed to Git): - `github_organization`: the GitHub organisation where the plugin repository is hosted. - - `github_username`: The GitHub username granting access to the plugin repository. - - `github_access_token`: The GitHub access token required to upload and commit changes to the plugin repository. - - `github_commit_email`: The email address associated with your GitHub account. -2. Use the following command to package and create a release for your plugin on GitHub: - ```bash - ./gradlew :plugins:nf-nomad:upload - ``` +2. Use the following steps to package and create a release for your plugin on GitHub: + + - set the desired `version` value in `gradle.properties` and commit the change in the `master` branch + - tag the repo with the version + - push *all* changes (the tag fill fire the `release` GH action) + + Once the action is finished a new release is created and all related artifacts attached to it 3. Create a pull request against [nextflow-io/plugins](https://github.com/nextflow-io/plugins/blob/main/plugins.json) to make the plugin accessible to Nextflow. + + Use the `json` file created in previous steps diff --git a/build.gradle b/build.gradle index 349fa64..9a59323 100644 --- a/build.gradle +++ b/build.gradle @@ -16,13 +16,6 @@ import nextflow.gradle.plugins.NextflowPlugin apply plugin: NextflowPlugin -ext{ - github_organization = 'nextflow-io' - github_username = project.findProperty('github_username') ?: 'abhi18av' - github_access_token = project.findProperty('github_access_token') ?: System.getenv('GITHUB_TOKEN') - github_commit_email = project.findProperty('github_commit_email') ?: 'abhi18av@outlook.com' -} - nextflowPlugin{ githubOrganization = github_organization extensionPoints = [ diff --git a/gradle.properties b/gradle.properties index ce0c6a9..ffb4e04 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,2 @@ -version=0.1.0 \ No newline at end of file +version=0.1.0 +github_organization= 'nextflow-io' \ No newline at end of file