Skip to content

Commit 5f9bcf8

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 dbf2b74 commit 5f9bcf8

11 files changed

Lines changed: 333 additions & 257 deletions

.craft.yml

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

.github/workflows/build.yml

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

.github/workflows/build_assets.yml

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

.github/workflows/create-release.yml

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

0 commit comments

Comments
 (0)