From b09d781bcf8471e494b71ecec9b256d7bee094ca Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Thu, 12 Sep 2024 18:15:05 -0400 Subject: [PATCH 1/3] docs: use raw img links for contrib guide --- .github/CONTRIBUTING.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index bcd626b..6071d3b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -17,7 +17,7 @@ as our collaboration process. Follow the steps below for detailed instructions on contributing changes to TOOL_NAME. -![GitHub Flow diagram](./img/GitHub-Flow_bg-white.png) +![GitHub Flow diagram](https://raw.githubusercontent.com/CCBR/CCBR_NextflowTemplate/main/.github/img/GitHub-Flow_bg-white.png) ### Clone the repo @@ -196,9 +196,7 @@ git push --set-upstream origin iss-10 > remote: Create a pull request for 'iss-10' on GitHub by visiting:
> remote: https://github.com/CCBR/TOOL_NAME/pull/new/iss-10
> remote:
-> To https://github.com/CCBR/TOOL_NAME
->
-> [new branch] iss-10 -> iss-10
+> To https://github.com/CCBR/TOOL_NAME
>
> [new branch] iss-10 -> iss-10
> branch 'iss-10' set up to track 'origin/iss-10'.
We recommend pushing your commits often so they will be backed up on GitHub. @@ -213,7 +211,7 @@ Once your branch is ready, create a PR on GitHub: Select the branch you just pushed: -![Create a new PR from your branch](./img/new-PR.png) +![Create a new PR from your branch](https://raw.githubusercontent.com/CCBR/CCBR_NextflowTemplate/main/.github/img/new-PR.png) Edit the PR title and description. The title should briefly describe the change. @@ -223,7 +221,7 @@ Be sure to fill out the checklist, checking off items as you complete them or striking through any irrelevant items. When you're ready, click 'Create pull request' to open it. -![Open the PR after editing the title and description](./img/create-PR.png) +![Open the PR after editing the title and description](https://raw.githubusercontent.com/CCBR/CCBR_NextflowTemplate/main/.github/img/create-PR.png) Optionally, you can mark the PR as a draft if you're not yet ready for it to be reviewed, then change it later when you're ready. From 4d275560e4fb0472b84814d224007bdfa547c604 Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Fri, 13 Sep 2024 10:01:33 -0400 Subject: [PATCH 2/3] ci: update from CCBR/actions examples --- .../{build.yml => build-nextflow.yml} | 25 +++++++++++++--- .github/workflows/docs-mkdocs.yml | 25 ++++++++++++++++ .github/workflows/docs.yml | 29 ------------------- .github/workflows/draft-release.yml | 25 ++++++++++++++++ .github/workflows/post-release.yml | 17 +++++++++++ mkdocs.yml | 4 +++ 6 files changed, 92 insertions(+), 33 deletions(-) rename .github/workflows/{build.yml => build-nextflow.yml} (56%) create mode 100644 .github/workflows/docs-mkdocs.yml delete mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/draft-release.yml create mode 100644 .github/workflows/post-release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build-nextflow.yml similarity index 56% rename from .github/workflows/build.yml rename to .github/workflows/build-nextflow.yml index 38d5661..84082e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build-nextflow.yml @@ -13,11 +13,10 @@ on: jobs: build: runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 2 strategy: matrix: - python-version: ["3.9"] - + python-version: ["3.11"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -27,7 +26,7 @@ jobs: cache: "pip" - name: Install nextflow uses: nf-core/setup-nextflow@v1 - - name: Install dependencies + - name: Install Python dependencies run: | python -m pip install --upgrade pip setuptools pip install .[dev,test] @@ -42,3 +41,21 @@ jobs: - name: Stub run run: | tool_name run -profile ci_stub,docker -stub + - name: "Upload Artifact" + uses: actions/upload-artifact@v3 + if: always() # run even if previous steps fail + with: + name: nextflow-log + path: .nextflow.log + + build-status: # https://github.com/orgs/community/discussions/4324#discussioncomment-3477871 + runs-on: ubuntu-latest + needs: [build] + if: always() + steps: + - name: Successful build + if: ${{ !(contains(needs.*.result, 'failure')) }} + run: exit 0 + - name: Failing build + if: ${{ contains(needs.*.result, 'failure') }} + run: exit 1 diff --git a/.github/workflows/docs-mkdocs.yml b/.github/workflows/docs-mkdocs.yml new file mode 100644 index 0000000..89b719b --- /dev/null +++ b/.github/workflows/docs-mkdocs.yml @@ -0,0 +1,25 @@ +name: docs +on: + workflow_dispatch: + release: + types: + - published + push: + branches: + - main + paths: + - "docs/**" + - "**.md" + - .github/workflows/docs-mkdocs.yml + - mkdocs.yml + +jobs: + mkdocs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: CCBR/actions/mkdocs-mike@v0.1 + with: + github-token: ${{ github.token }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index d4db0e8..0000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: mkdocs_build -on: - workflow_dispatch: - push: - branches: - - main - paths: - - "docs/**" - - "README.md" - - ".github/*.md" - -env: - actor: "41898282+github-actions[bot]" - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: git config - run: | - git config --local user.email "${actor}@users.noreply.github.com" - git config --local user.name "$actor" - - run: pip install --upgrade pip - - run: pip install -r docs/requirements.txt - - run: mkdocs gh-deploy --force diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml new file mode 100644 index 0000000..d643f5c --- /dev/null +++ b/.github/workflows/draft-release.yml @@ -0,0 +1,25 @@ +name: draft-release + +on: + workflow_dispatch: + inputs: + version-tag: + description: | + Semantic version tag for next release. + If not provided, it will be determined based on conventional commit history. + Example: v2.5.11 + required: false + type: string + default: "" + +jobs: + draft-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # required to include tags + - uses: CCBR/actions/draft-release@v0.1 + with: + github-token: ${{ github.token }} + version-tag: ${{ github.event.inputs.version-tag }} diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml new file mode 100644 index 0000000..e0e21eb --- /dev/null +++ b/.github/workflows/post-release.yml @@ -0,0 +1,17 @@ +name: post-release + +on: + release: + types: + - published + +jobs: + cleanup: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: CCBR/actions/post-release@v0.1 + with: + github-token: ${{ github.token }} diff --git a/mkdocs.yml b/mkdocs.yml index cbe842c..be03df8 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -39,6 +39,10 @@ plugins: - git-revision-date - minify: minify_html: true + - mike: + alias_type: symlink + canonical_version: latest + version_selector: true # Customization extra: From f284a17078d0fe841c9b135a8ce4f1d6a48ffa7b Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Fri, 13 Sep 2024 10:05:00 -0400 Subject: [PATCH 3/3] docs: fix miscapitalized example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0b5a513..593d89c 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ pip3 install -e . Run the example ```sh -TOOL_NAME run --input "Hello world" +tool_name run --input "Hello world" ``` ![dag](assets/dag.png)