Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 30 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
gh release upload --repo runtimeverification/k --clobber "v${version}" "${tarball}"

cachix-release:
name: 'k-framework-binary cachix release'
name: 'Cachix release (binary cache + dependency closure)'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: 'Cachix release (binary cache + dependency closure)'
name: 'Cachix release (binary cache `k-framework-binary` + dependency cache `k-framework`)'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

strategy:
matrix:
include:
Expand Down Expand Up @@ -79,7 +79,20 @@ jobs:
with:
name: k-framework-binary

- name: 'Publish K to k-framework-binary cache'
# The binary publish and the dependency-closure publish build the same three
# derivations. Running them as sequential steps on one runner means the build
# happens once: the first step populates the local Nix store, so the second
# step's `nix build` is an instant store hit rather than a full recompile.
#
# The two publishes target different caches with different tokens (private
# `k-framework-binary` via kup vs. public `k-framework` via cachix), so they are
# kept independent: `continue-on-error` plus `if: always()` ensures a flaky
# upload to one cache neither blocks nor masks the other, and the final guard
# re-fails the job if either push failed — preserving the release gate that the
# two separate jobs used to provide.
- name: 'Publish K to k-framework-binary cache (private)'
id: binary
continue-on-error: true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bloated AI comment that reasons why the old pattern of two workflows was merged into one. Once we've adopted this pattern everywhere, this comment will be confusing since it's not clear that the workflows was split in two in the first place.

If you wish to add a clarifying comment, keep it short and concise, simply just describing what the workflow does.

Though I agree that the differentian between the caches k-framework and k-framework-binary was never properly documented. Though I doubt that the proper place is a long comment in a workflow in one of our dependency projects. Rather, there should be proper documentation in possibly https://github.com/runtimeverification/rv-nix-tools/tree/master/docs.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

uses: workflow/nix-shell-action@v3.3.2
env:
CACHIX_AUTH_TOKEN: '${{ secrets.CACHIX_PRIVATE_KFB_TOKEN }}'
Expand All @@ -91,7 +104,7 @@ jobs:
script: |
# Install kup
export PATH="$(nix build github:runtimeverification/kup --no-link --json | jq -r '.[].outputs | to_entries[].value')/bin:$PATH"

# Publish all three package variants using kup publish
# Using public macOS runner has proven reliable for large file uploads
kup publish --verbose k-framework-binary .#k --keep-days 180 || true
Expand All @@ -101,38 +114,10 @@ jobs:
# kup/cachix pin visibility can be flaky; verify pins and narinfo via public API
bash .github/scripts/check-cachix-pin.sh

cachix-release-dependencies:
name: 'k-framework cachix release'
strategy:
matrix:
include:
- runner: ubuntu-24.04
os: ubuntu-24.04
- runner: macos-latest
os: macos-15
runs-on: ${{ matrix.runner }}
timeout-minutes: 120
steps:
- name: 'Check out code'
uses: actions/checkout@v4

- name: 'Install Nix'
if: ${{ !startsWith(matrix.os, 'self') }}
uses: cachix/install-nix-action@v31.5.1
with:
install_url: https://releases.nixos.org/nix/nix-2.30.1/install
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
substituters = http://cache.nixos.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=

- name: 'Install Cachix'
if: ${{ !startsWith(matrix.os, 'self') }}
uses: cachix/cachix-action@v14
with:
name: k-framework-binary

- name: 'Build and cache K and K dependencies'
- name: 'Build and cache K and K dependencies (public)'
id: dependencies
if: always()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if: always() is unnecessary, since the previous step already declared continue-on-error

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

continue-on-error: true
uses: workflow/nix-shell-action@v3
env:
GC_DONT_GC: 1
Expand All @@ -152,6 +137,15 @@ jobs:
DRV_K_OPENSSL_PROCPS_SECP256K1=$(nix-store --query --deriver ${K_OPENSSL_PROCPS_SECP256K1})
nix-store --query --requisites --include-outputs ${DRV_K_OPENSSL_PROCPS_SECP256K1} | cachix push k-framework

- name: 'Fail if either cachix publish failed'
if: always()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same unnecessary if: always(), see above comment.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

run: |
binary='${{ steps.binary.outcome }}'
dependencies='${{ steps.dependencies.outcome }}'
echo "binary publish: ${binary}"
echo "dependencies publish: ${dependencies}"
[ "${binary}" = 'success' ] && [ "${dependencies}" = 'success' ]

pyk-build-wheel:
name: 'Pyk: Build Python wheel'
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -313,7 +307,7 @@ jobs:
name: 'Publish Release'
runs-on: [self-hosted, linux, normal]
environment: production
needs: [cachix-release, cachix-release-dependencies, source-tarball, ubuntu-jammy, ubuntu-noble, set-release-id]
needs: [cachix-release, source-tarball, ubuntu-jammy, ubuntu-noble, set-release-id]
steps:
- name: 'Check out code'
uses: actions/checkout@v4
Expand Down
Loading