From 7f92b2096d2bfa20a1773e909a92bf27ecf73745 Mon Sep 17 00:00:00 2001 From: everoddandeven Date: Wed, 18 Nov 2026 16:48:24 +0100 Subject: [PATCH 1/3] ci: fix job name for debian package build --- .github/workflows/build-deb.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deb.yml b/.github/workflows/build-deb.yml index 925ef59..b5a8e24 100644 --- a/.github/workflows/build-deb.yml +++ b/.github/workflows/build-deb.yml @@ -42,7 +42,7 @@ permissions: jobs: build: - name: ${{ contains('noble jammy', matrix.name) && 'ubuntu' || 'debian' }} (${{ matrix.name }} / ${{ matrix.arch }}) + name: ${{ contains('noble jammy', matrix.name) && 'ubuntu' || 'debian' }} ${{ matrix.name }} (${{ matrix.arch }}) runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || 'ubuntu-24.04-arm' }} timeout-minutes: 360 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 002cd16..6f365c9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,7 +53,7 @@ jobs: # every release and architecture, the builds of main only have some of them deb: - name: Build the deb packages + name: Build debian packages needs: check uses: ./.github/workflows/build-deb.yml permissions: From df0b814351d2a6f89f11affd0670b5cb46ba44df Mon Sep 17 00:00:00 2001 From: everoddandeven Date: Wed, 18 Nov 2026 17:08:35 +0100 Subject: [PATCH 2/3] ci: add source tarball with submodules to release --- .github/release-notes.md | 20 ++++++++++++++++++++ .github/workflows/release.yml | 27 +++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 .github/release-notes.md diff --git a/.github/release-notes.md b/.github/release-notes.md new file mode 100644 index 0000000..a8fef75 --- /dev/null +++ b/.github/release-notes.md @@ -0,0 +1,20 @@ +## Which file to download + +| Platform | File | +| --- | --- | +| Debian (`bookworm`, `trixie`) and Ubuntu (`jammy`, `noble`) on `amd64`, `arm64`, `armhf` | `python3-monero_-11_.deb`, installed with `sudo apt install ./` | +| macOS (Apple silicon and Intel) | `monero---macosx_*.whl` | +| Windows (x86_64) | `monero---win_amd64.whl` | +| Anything else | `monero-python-.tar.gz`, the source with its submodules (the "Source code" archives of GitHub have none of them) | + +`coverage_monero_cpp_html.zip` is the coverage report of the tests. + +## Verify a download + +```bash +sha256sum -c --ignore-missing SHA256SUMS +gh attestation verify --repo libmonero/monero-python +``` + +The first checks the file against the list published with the release, the second that it was built by the release workflow of this repository. + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f365c9..ab33b2f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -74,6 +74,28 @@ jobs: id-token: write steps: + # the archive that GitHub attaches to a release is a git archive of the tag, with none of the submodules + # that the build needs + - name: Checkout repository with its submodules + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + path: source + submodules: recursive + persist-credentials: false + + # the same tree gives the same bytes: sorted, with the time of the commit and no owner or name of the file in the gzip header + - name: Pack the source with its submodules + working-directory: source + env: + TAG: ${{ github.ref_name }} + run: | + prefix="monero-python-${TAG#v}" + mkdir -p ../release-assets + git ls-files --recurse-submodules -z \ + | tar --null -T - --sort=name --mtime="@$(git log -1 --format=%ct)" --owner=0 --group=0 --numeric-owner \ + --transform "flags=rSH;s,^,${prefix}/," -cf - \ + | gzip -n > "../release-assets/${prefix}.tar.gz" + - name: Download deb packages uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: @@ -116,7 +138,7 @@ jobs: # to check a download against what the workflow published: sha256sum -c SHA256SUMS - name: Checksum the assets working-directory: release-assets - run: sha256sum -- *.deb *.whl *.zip > SHA256SUMS + run: sha256sum -- *.deb *.whl *.zip *.tar.gz > SHA256SUMS # lets anyone check an asset against this workflow: gh attestation verify --repo libmonero/monero-python - name: Attest the assets @@ -133,5 +155,6 @@ jobs: --repo "$GITHUB_REPOSITORY" \ --draft \ --title "$TAG" \ + --notes-file source/.github/release-notes.md \ --generate-notes \ - release-assets/*.deb release-assets/*.whl release-assets/*.zip release-assets/SHA256SUMS + release-assets/*.deb release-assets/*.whl release-assets/*.zip release-assets/*.tar.gz release-assets/SHA256SUMS From d5fefacb8d5bdfb93ef51af3671eef88edb25b50 Mon Sep 17 00:00:00 2001 From: everoddandeven Date: Wed, 18 Nov 2026 17:14:48 +0100 Subject: [PATCH 3/3] ci: build every deb on main, all architectures of ubuntu and trixie on pull requests --- .github/workflows/build-deb.yml | 21 +++++---------------- .github/workflows/release.yml | 4 +--- docs/ci-ccache.md | 2 +- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-deb.yml b/.github/workflows/build-deb.yml index b5a8e24..5bc772c 100644 --- a/.github/workflows/build-deb.yml +++ b/.github/workflows/build-deb.yml @@ -1,9 +1,8 @@ name: Build Debian Packages # Builds the package from debian/ with dpkg-buildpackage in a container of each release. -# Pull requests build amd64 on trixie and bookworm. Main also builds amd64 on noble and jammy -# and arm64 on trixie and bookworm. The release (called by release.yml) and the manual runs with -# full build all of them. arm64 and armhf are built natively on arm runners, which run 32 bit +# Pull requests build noble, jammy and trixie, main, the release (called by release.yml) and the +# manual runs build bookworm too. Each one on amd64, arm64 and armhf. arm64 and armhf are built natively on arm runners, which run 32 bit # arm containers. on: push: @@ -18,17 +17,7 @@ on: - 'bin/check_elf_hardening.sh' - 'CMakeLists.txt' workflow_dispatch: - inputs: - full: - description: Build every release and architecture - type: boolean - default: false workflow_call: - inputs: - full: - description: Build every release and architecture - type: boolean - default: false # A new push to a pull request cancels the previous run. Other events get their own # group so they are never cancelled or replaced. @@ -51,9 +40,9 @@ jobs: matrix: name: [noble, jammy, trixie, bookworm] arch: [amd64, arm64, armhf] - # pull requests build amd64 on trixie and bookworm, main adds amd64 on the Ubuntu releases and - # arm64 on the Debian ones, the tags and the manual runs with full build everything - exclude: ${{ fromJSON((github.ref_type == 'tag' || inputs.full) && '[]' || (github.event_name == 'pull_request' && '[{"arch":"armhf"},{"arch":"arm64"},{"name":"noble"},{"name":"jammy"}]' || '[{"arch":"armhf"},{"arch":"arm64","name":"noble"},{"arch":"arm64","name":"jammy"}]')) }} + # pull requests leave out bookworm, everything else (main, tags, manual runs) builds all of them. Every + # architecture is built each time: a flag of the compiler that only one of them rejects was found at a release + exclude: ${{ fromJSON(github.event_name == 'pull_request' && '[{"name":"bookworm"}]' || '[]') }} steps: - name: Checkout repository diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab33b2f..5015ac2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,7 +51,7 @@ jobs: fi echo "build_run_id=${run_id}" >> "$GITHUB_OUTPUT" - # every release and architecture, the builds of main only have some of them + # every release and architecture, built again for the tag deb: name: Build debian packages needs: check @@ -59,8 +59,6 @@ jobs: permissions: contents: read actions: write # build-deb.yml replaces its ccache entries - with: - full: true release: name: Publish draft release diff --git a/docs/ci-ccache.md b/docs/ci-ccache.md index bdf99c6..9aa04dc 100644 --- a/docs/ci-ccache.md +++ b/docs/ci-ccache.md @@ -15,7 +15,7 @@ The workflows keep a ccache directory (`.ccache` in the workspace) between runs - Each build has its own cache: Linux, Windows and macOS (one for each architecture) in `ci.yml`, and the deb builds one per distro and arch. The tests do not compile, they use what the builds uploaded. - Pull requests only restore. Pushes to main and manual runs (`workflow_dispatch`) save. This is on purpose, see quota below. The deb workflow also runs on pull requests that touch its own files, and follows the same rule. - A cache saved on a branch is only visible to that branch. Main's caches are visible to everyone, so a pull request starts from main's. -- Saving deletes only the entry of the same key and of the ref that is running (the API call has a `ref`): deleting by key alone removes the entries of every ref, and a manual run on a branch would take away main's. A tag does not save in the deb workflow, its entry would only be readable by that tag, and the release builds from the caches of main (the legs that main does not build, armhf and arm64 on Ubuntu, start with no cache). +- Saving deletes only the entry of the same key and of the ref that is running (the API call has a `ref`): deleting by key alone removes the entries of every ref, and a manual run on a branch would take away main's. A tag does not save in the deb workflow, its entry would only be readable by that tag, and the release builds from the caches of main (main builds all 12 legs, so each one has a cache). - The save step runs after the build and before the tests, so a flaky test doesn't throw the cache away. Failed builds save too, whatever got compiled is still good. ### What isn't cached