diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml deleted file mode 100644 index d0bbe59..0000000 --- a/.github/workflows/greetings.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Greetings - -on: [pull_request, issues] - -jobs: - greeting: - runs-on: ubuntu-latest - steps: - - uses: actions/first-interaction@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: 'Hi there! Thanks for opening your first issue!' - pr-message: 'Hi there! Thanks for opening your first pull request!' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1e7db51 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,58 @@ +on: + release: + types: [published] + +name: Attach Rendered Site to Release + +permissions: + contents: write + +jobs: + build-and-attach: + name: Build Site and Upload Release Asset + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v5 + + - name: Overwrite _quarto.yml + if: github.repository == 'maehr/open-research-data-template' + run: | + cp .github/_quarto.yml _quarto.yml + + - name: Set up Quarto + uses: quarto-dev/quarto-actions/setup@v2 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Install uv + uses: astral-sh/setup-uv@v6 + + - name: Sync Python dependencies + run: uv sync + + - name: Setup R + uses: r-lib/actions/setup-r@v2 + with: + r-version: renv + - uses: r-lib/actions/setup-renv@v2 + + - name: Render Quarto Project + run: uv run quarto render --to html + + - name: JamPack Optimization + run: | + npx @divriots/jampack ./_site + + - name: Package site into ZIP + run: | + cd _site + zip -r ../site-${{ github.event.release.tag_name }}.zip . + + - name: Upload release asset + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: site-${{ github.event.release.tag_name }}.zip diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 519a9f7..8095453 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,4 +5,40 @@ repos: name: Prettier check entry: npm run check language: system + types_or: [yaml, json, markdown, html, css, scss, javascript, ts] + stages: [pre-commit] + + - id: ruff-format + name: Ruff Format + entry: bash -c 'if command -v uv >/dev/null 2>&1 && uv run ruff --version >/dev/null 2>&1; then uv run ruff format "$@"; else exit 0; fi' -- + language: system + types: [python] + stages: [pre-commit] + + - id: ruff-lint + name: Ruff Lint + entry: bash -c 'if command -v uv >/dev/null 2>&1 && uv run ruff --version >/dev/null 2>&1; then uv run ruff check "$@"; else exit 0; fi' -- + language: system + types: [python] + stages: [pre-commit] + + - id: ty-check + name: Ty Check + entry: bash -c 'if command -v uv >/dev/null 2>&1 && uv run ty --version >/dev/null 2>&1; then uv run ty check "$@"; else exit 0; fi' -- + language: system + types: [python] + stages: [pre-commit] + + - id: r-format + name: R Format + entry: bash -c 'if command -v Rscript >/dev/null 2>&1 && Rscript -e "suppressPackageStartupMessages(stopifnot(requireNamespace('\''styler'\'', quietly=TRUE)))" >/dev/null 2>&1; then Rscript -e "styler::style_file(commandArgs(TRUE))" "$@"; else exit 0; fi' -- + language: system + types: [r] + stages: [pre-commit] + + - id: r-lint + name: R Lint + entry: bash -c 'if command -v Rscript >/dev/null 2>&1 && Rscript -e "suppressPackageStartupMessages(stopifnot(requireNamespace('\''lintr'\'', quietly=TRUE)))" >/dev/null 2>&1; then Rscript -e "for (f in commandArgs(TRUE)) print(lintr::lint(f))" "$@"; else exit 0; fi' -- + language: system + types: [r] stages: [pre-commit] diff --git a/AGENTS.md b/AGENTS.md index b63dde5..c369825 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -114,6 +114,7 @@ Place new files accordingly. ## 10) Zenodo Integration and DOI (Project instances) - **Enable Zenodo–GitHub integration** to archive releases and mint DOIs. +- The `release.yml` workflow automatically builds the rendered site and attaches it as a `site-.zip` release asset so that Zenodo archives the HTML documentation alongside the source code. - After first release: - Record your **`ZENODO_RECORD`** and **`DOI`**. - **Zenodo DOI badge**: replace `GITHUB_REPO_ID` with the numeric repo ID from `https://api.github.com/repos/USERNAME/REPO_NAME` (`id` field). Badge will display your DOI after Zenodo links the release. diff --git a/README.md b/README.md index a564405..a74830e 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Conventional data publication as static supplementary files offers limited repro ### Open Research Data - Citable via [DOI](https://www.doi.org/) and [CITATION.cff](https://citation-file-format.github.io/) -- Automatic long-term archiving with [Zenodo](https://zenodo.org/) +- Automatic long-term archiving with [Zenodo](https://zenodo.org/), including the rendered documentation site as a release asset - Licensed under [AGPL 3.0](https://www.gnu.org/licenses/agpl-3.0.html) and [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/deed) according to [The Turing Way](https://the-turing-way.netlify.app/reproducible-research/rdm/rdm-sharing.html#step-3-choose-a-licence-and-link-to-your-paper-and-code) - Template for reporting data issues via `github/ISSUE_TEMPLATE/data_issue_report.yml` @@ -67,7 +67,6 @@ Conventional data publication as static supplementary files offers limited repro ### Ethics - `CODE_OF_CONDUCT.md` following the [Contributor Covenant](https://www.contributor-covenant.org/) -- Supportive first interactions via [Greetings](https://github.com/actions/starter-workflows/blob/main/automation/greetings.yml) ## Selected Use Cases diff --git a/TODO.md b/TODO.md index 9bbb39b..f7841db 100644 --- a/TODO.md +++ b/TODO.md @@ -33,8 +33,8 @@ Complete the following steps after creating your project from this template to c ## Optional Enhancements - [ ] **Add Zenodo Metadata File**: Create a `.zenodo.json` file to control metadata sent to Zenodo during archival. Include custom creators, contributors, keywords, and license information. See [Zenodo developer documentation](https://developers.zenodo.org/?python#add-metadata-to-your-github-repository-release) for schema details. - - [ ] **Review Project-Management Files**: Populate or remove the files in `project-management/` before publishing. These are placeholder templates for meeting notes and project plans. +- [ ] **Rendered Site in Releases**: The `release.yml` workflow automatically builds the Quarto site and attaches a `site-.zip` to each GitHub release. This ensures the rendered HTML documentation is preserved alongside the source archive when Zenodo captures the release. ## Verification Steps