Skip to content

Commit a1e2dd7

Browse files
revert: restore original codecov-cli release process
The release process inherited from getsentry/prevent-cli (Craft + build.yml + create-release.yml + release-codecov-cli.yml) is broken. Roll back to the original codecov-cli release flow, adapted for the current monorepo layout where the package lives under codecov-cli/. Removed: - .craft.yml - .github/workflows/build.yml (Craft-driven build of both CLIs) - .github/workflows/create-release.yml (getsentry/action-prepare-release) - .github/workflows/release-codecov-cli.yml (PyPI publish triggered by Craft release) - scripts/{bump-version.sh,build_alpine.sh,build_linux.sh,pre-build.sh,uv-installer-0.7.8.sha256sum} Restored (adapted to codecov-cli/ subdirectory + uv): - .github/workflows/create_release_pr.yml: workflow_dispatch bumps codecov-cli/pyproject.toml on a release/<version> branch and opens a PR into main. - .github/workflows/create_release.yml: on merge of a release/* PR, cuts the v<version> GitHub release. - .github/workflows/release_flow.yml: on release creation, calls build_for_pypi + build_assets, publishes to PyPI, and announces the release via the GCS pub/sub topic. - .github/workflows/build_for_pypi.yml: uv build of the codecov-cli sdist + wheel. - .github/workflows/build_assets.yml: pyinstaller binaries for macOS / Ubuntu / Windows + alpine and linux arm via Docker. - scripts/build_alpine_arm.sh and scripts/build_linux_arm.sh: Docker entrypoints that build the codecovcli_<distro>_<arch> binary out of codecov-cli/. prevent-cli sources are left in place but are no longer part of the release pipeline.
1 parent beb955d commit a1e2dd7

16 files changed

Lines changed: 340 additions & 373 deletions

.craft.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 0 additions & 197 deletions
This file was deleted.

.github/workflows/build_assets.yml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: Build Compiled Assets
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
release:
7+
type: boolean
8+
default: false
9+
description: "Attach artifacts to a release"
10+
11+
jobs:
12+
build_assets:
13+
name: Build packages - ${{ matrix.os }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: true
17+
matrix:
18+
include:
19+
- os: macos-latest
20+
TARGET: macos
21+
CMD_BUILD: >
22+
cd codecov-cli &&
23+
uv run pyinstaller --target-arch universal2 -F codecov_cli/main.py &&
24+
mv dist/main dist/codecovcli_macos &&
25+
lipo -archs dist/codecovcli_macos | grep 'x86_64 arm64'
26+
OUT_FILE_NAME: codecovcli_macos
27+
ASSET_MIME: application/octet-stream
28+
- os: ubuntu-22.04
29+
TARGET: ubuntu
30+
CMD_BUILD: >
31+
cd codecov-cli &&
32+
uv run pyinstaller -F codecov_cli/main.py &&
33+
cp ./dist/main ./dist/codecovcli_linux
34+
OUT_FILE_NAME: codecovcli_linux
35+
ASSET_MIME: application/octet-stream
36+
- os: windows-latest
37+
TARGET: windows
38+
CMD_BUILD: >
39+
Set-Location .\codecov-cli &&
40+
uv run pyinstaller -F .\codecov_cli\main.py &&
41+
Copy-Item -Path ".\dist\main.exe" -Destination ".\dist\codecovcli_windows.exe"
42+
OUT_FILE_NAME: codecovcli_windows.exe
43+
ASSET_MIME: application/vnd.microsoft.portable-executable
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Set up Python 3.11
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: "3.11"
51+
52+
- name: Install uv and dependencies
53+
run: |
54+
pip install uv
55+
# Need to build pyyaml and ijson from sdists to get universal2 macos build to work
56+
cd codecov-cli
57+
uv sync --no-binary-package pyyaml --no-binary-package ijson
58+
59+
- name: Build with pyinstaller for ${{matrix.TARGET}}
60+
run: ${{matrix.CMD_BUILD}}
61+
62+
- name: Upload a Build Artifact
63+
uses: actions/upload-artifact@v4
64+
if: inputs.release == false
65+
with:
66+
name: ${{ matrix.OUT_FILE_NAME }}
67+
path: ./codecov-cli/dist/${{ matrix.OUT_FILE_NAME }}
68+
69+
- name: Upload Release Asset
70+
if: inputs.release == true
71+
id: upload-release-asset
72+
uses: svenstaro/upload-release-action@v2
73+
with:
74+
repo_token: ${{ secrets.GITHUB_TOKEN }}
75+
file: ./codecov-cli/dist/${{ matrix.OUT_FILE_NAME }}
76+
asset_name: ${{ matrix.OUT_FILE_NAME }}
77+
tag: ${{ github.ref }}
78+
overwrite: true
79+
80+
build_assets_alpine_arm:
81+
name: Build assets - Alpine and ARM
82+
runs-on: ${{ matrix.runs-on }}
83+
strategy:
84+
matrix:
85+
include:
86+
- distro: "alpine:3.14"
87+
arch: arm64
88+
distro_name: alpine
89+
runs-on: ubuntu-24.04-arm
90+
- distro: "alpine:3.14"
91+
arch: x86_64
92+
distro_name: alpine
93+
runs-on: ubuntu-24.04
94+
- distro: "ubuntu:20.04"
95+
arch: arm64
96+
distro_name: linux
97+
runs-on: ubuntu-24.04-arm
98+
99+
steps:
100+
- uses: actions/checkout@v4
101+
102+
- name: Run in Docker
103+
run: |
104+
docker run \
105+
--rm \
106+
-v $(pwd):/${{ github.workspace }} \
107+
-w ${{ github.workspace }} \
108+
--platform linux/${{ matrix.arch }} \
109+
${{ matrix.distro }} \
110+
./scripts/build_${{ matrix.distro_name }}_arm.sh ${{ matrix.distro_name }}_${{ matrix.arch }}
111+
112+
- name: Upload a Build Artifact
113+
uses: actions/upload-artifact@v4
114+
if: inputs.release == false
115+
with:
116+
name: codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }}
117+
path: ./codecov-cli/dist/codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }}
118+
119+
- name: Upload Release Asset
120+
if: inputs.release == true
121+
id: upload-release-asset
122+
uses: svenstaro/upload-release-action@v2
123+
with:
124+
repo_token: ${{ secrets.GITHUB_TOKEN }}
125+
file: ./codecov-cli/dist/codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }}
126+
asset_name: codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }}
127+
tag: ${{ github.ref }}
128+
overwrite: true
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Build for PyPi
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
publish:
8+
type: boolean
9+
default: false
10+
description: "Build for PyPi"
11+
12+
jobs:
13+
build_for_pypi:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
persist-credentials: false
19+
20+
- name: Install uv
21+
run: pip install uv
22+
23+
- name: Build sdist and wheel
24+
run: |
25+
cd codecov-cli
26+
uv build
27+
28+
- name: Store the distribution packages
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: cibw-codecov-cli
32+
path: ./codecov-cli/dist/*

0 commit comments

Comments
 (0)