From 30c1849ee0aa09b32c06039aa17793b23b243454 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 10 Jan 2026 13:07:17 +0000 Subject: [PATCH 1/2] Release from CI: 079d015f571527c596cbe0fb240746772ead2cf3 --- .github/workflows/build-deploy-tarball.yaml | 121 ++++++++++++++++++++ README.md | 6 +- 2 files changed, 124 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build-deploy-tarball.yaml diff --git a/.github/workflows/build-deploy-tarball.yaml b/.github/workflows/build-deploy-tarball.yaml new file mode 100644 index 0000000..ba9dd6a --- /dev/null +++ b/.github/workflows/build-deploy-tarball.yaml @@ -0,0 +1,121 @@ +name: Release Candidate + +on: + pull_request: + branches: [ "main" ] + +jobs: + # ----------------------------------------------------------------------------- + # JOB 1: Build Artifact + # ----------------------------------------------------------------------------- + build: + if: github.head_ref == 'package-pre_prod' + runs-on: ubuntu-latest + outputs: + tarball: ${{ steps.pkg_info.outputs.tarball }} + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: 'release' + + - name: Build with devtools + id: pkg_info + run: | + install.packages("devtools") + + # Clean up any potential old files + rm -f *.tar.gz + + # 1. Build using devtools + # This automatically creates 'PackageName_Version.tar.gz' + devtools::build(path = ".") + + # 2. Capture that exact filename + TARBALL=$(ls *.tar.gz) + + # 3. Save it for other jobs + echo "tarball=$TARBALL" >> $GITHUB_OUTPUT + shell: Rscript {0} + + - name: Save Artifact + uses: actions/upload-artifact@v4 + with: + name: cran-tarball + path: ${{ steps.pkg_info.outputs.tarball }} + + # ----------------------------------------------------------------------------- + # JOB 2: WinBuilder (Release & Devel) + # ----------------------------------------------------------------------------- + winbuilder: + needs: build + runs-on: ubuntu-latest + steps: + - uses: r-lib/actions/setup-r@v2 + with: + r-version: 'release' + use-public-rspm: true + + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + name: cran-tarball + path: . + + - name: Submit to WinBuilder + run: | + install.packages("devtools") + pkg_tarball <- "${{ needs.build.outputs.tarball }}" + + print(paste("Submitting", pkg_tarball, "to WinBuilder...")) + + # 1. Check against R-release (Current Stable) + tryCatch( + devtools::check_win_release(pkg = pkg_tarball), + error = function(e) message("Release upload failed: ", e$message) + ) + + # 2. Check against R-devel (Future Version) + tryCatch( + devtools::check_win_devel(pkg = pkg_tarball), + error = function(e) message("Devel upload failed: ", e$message) + ) + shell: Rscript {0} + + # ----------------------------------------------------------------------------- + # JOB 3: Validate (Install on all OSs) + # ----------------------------------------------------------------------------- + validate: + needs: build + runs-on: ${{ matrix.os }} + strategy: + # fail-fast: false + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + + steps: + - uses: r-lib/actions/setup-r@v2 + with: + r-version: 'release' + use-public-rspm: true + + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + name: cran-tarball + path: . + + - name: Install & Verify + run: | + pkg_tarball <- "${{ needs.build.outputs.tarball }}" + + # Install dependencies & the package itself + install.packages("remotes") + remotes::install_local(pkg_tarball, dependencies = TRUE, force = TRUE) + + # Quick load test to confirm it works + library(gsub("_.*", "", pkg_tarball), character.only = TRUE) + print("SUCCESS: Package installed and loaded.") + shell: Rscript {0} diff --git a/README.md b/README.md index d628077..f4bcafc 100644 --- a/README.md +++ b/README.md @@ -113,14 +113,14 @@ fit_et <- nmar( summary(fit_et) #> NMAR Model Summary (Exponential tilting) #> ================================= -#> y mean: -1.003956 +#> y mean: -1.004026 #> Converged: TRUE #> Variance method: none #> Call: nmar(y ~ x, data = , engine = exponential_tilting) #> #> Response-model (theta) coefficients: -#> (Intercept) : 0.864024 -#> y : -0.170260 +#> (Intercept) : 0.864196 +#> y : -0.170084 ``` Result objects returned by `nmar()` support methods such as `summary()`, From 826b506fd7bdada7b67063334b5053ff658e80da Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 10 Jan 2026 14:46:57 +0000 Subject: [PATCH 2/2] Release from CI: dda9a78951d6a48e53cd0d9ba85738b5e38b3ae4 --- .github/workflows/build-deploy-tarball.yaml | 58 +++++++++++++-------- README.md | 6 +-- 2 files changed, 38 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build-deploy-tarball.yaml b/.github/workflows/build-deploy-tarball.yaml index ba9dd6a..a06f437 100644 --- a/.github/workflows/build-deploy-tarball.yaml +++ b/.github/workflows/build-deploy-tarball.yaml @@ -21,23 +21,27 @@ jobs: with: r-version: 'release' + # Installs devtools AND system libraries (libcurl, etc.) + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: | + devtools + desc + - name: Build with devtools id: pkg_info run: | - install.packages("devtools") - - # Clean up any potential old files - rm -f *.tar.gz + # 1. Clean up old files (R syntax) + unlink(list.files(pattern = "\\.tar\\.gz$")) - # 1. Build using devtools - # This automatically creates 'PackageName_Version.tar.gz' + # 2. Build devtools::build(path = ".") - # 2. Capture that exact filename - TARBALL=$(ls *.tar.gz) + # 3. Capture filename (R syntax) + tarball_name <- list.files(pattern = "\\.tar\\.gz$")[1] - # 3. Save it for other jobs - echo "tarball=$TARBALL" >> $GITHUB_OUTPUT + # 4. Save to GitHub Output (R syntax) + cat(paste0("tarball=", tarball_name, "\n"), file = Sys.getenv("GITHUB_OUTPUT")) shell: Rscript {0} - name: Save Artifact @@ -47,7 +51,7 @@ jobs: path: ${{ steps.pkg_info.outputs.tarball }} # ----------------------------------------------------------------------------- - # JOB 2: WinBuilder (Release & Devel) + # JOB 2: WinBuilder # ----------------------------------------------------------------------------- winbuilder: needs: build @@ -56,7 +60,12 @@ jobs: - uses: r-lib/actions/setup-r@v2 with: r-version: 'release' - use-public-rspm: true + use-public-rspm: true # Speeds up installation + + # ADDED: Ensures devtools installs without missing system library errors + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: devtools - name: Download Artifact uses: actions/download-artifact@v4 @@ -66,18 +75,14 @@ jobs: - name: Submit to WinBuilder run: | - install.packages("devtools") pkg_tarball <- "${{ needs.build.outputs.tarball }}" + print(paste("Submitting", pkg_tarball)) - print(paste("Submitting", pkg_tarball, "to WinBuilder...")) - - # 1. Check against R-release (Current Stable) tryCatch( devtools::check_win_release(pkg = pkg_tarball), error = function(e) message("Release upload failed: ", e$message) ) - # 2. Check against R-devel (Future Version) tryCatch( devtools::check_win_devel(pkg = pkg_tarball), error = function(e) message("Devel upload failed: ", e$message) @@ -85,22 +90,30 @@ jobs: shell: Rscript {0} # ----------------------------------------------------------------------------- - # JOB 3: Validate (Install on all OSs) + # JOB 3: Validate # ----------------------------------------------------------------------------- validate: needs: build runs-on: ${{ matrix.os }} strategy: - # fail-fast: false + #fail-fast: false matrix: os: [windows-latest, ubuntu-latest, macos-latest] steps: + # Checkout is REQUIRED for setup-r-dependencies to read your DESCRIPTION file + - uses: actions/checkout@v4 + - uses: r-lib/actions/setup-r@v2 with: r-version: 'release' use-public-rspm: true + # ADDED: Installs dependencies safely on Linux (handles system libs like libxml2) + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + needs: check + - name: Download Artifact uses: actions/download-artifact@v4 with: @@ -111,11 +124,10 @@ jobs: run: | pkg_tarball <- "${{ needs.build.outputs.tarball }}" - # Install dependencies & the package itself - install.packages("remotes") - remotes::install_local(pkg_tarball, dependencies = TRUE, force = TRUE) + # Install the tarball + install.packages(pkg_tarball, repos = NULL, type = "source") - # Quick load test to confirm it works + # Test load library(gsub("_.*", "", pkg_tarball), character.only = TRUE) print("SUCCESS: Package installed and loaded.") shell: Rscript {0} diff --git a/README.md b/README.md index f4bcafc..0a74721 100644 --- a/README.md +++ b/README.md @@ -113,14 +113,14 @@ fit_et <- nmar( summary(fit_et) #> NMAR Model Summary (Exponential tilting) #> ================================= -#> y mean: -1.004026 +#> y mean: -1.003974 #> Converged: TRUE #> Variance method: none #> Call: nmar(y ~ x, data = , engine = exponential_tilting) #> #> Response-model (theta) coefficients: -#> (Intercept) : 0.864196 -#> y : -0.170084 +#> (Intercept) : 0.864080 +#> y : -0.170216 ``` Result objects returned by `nmar()` support methods such as `summary()`,