diff --git a/.craft.yml b/.craft.yml index 39d46330..49c1d33d 100644 --- a/.craft.yml +++ b/.craft.yml @@ -10,6 +10,6 @@ targets: tagPrefix: v checksums: - algorithm: sha256 - includeNames: /^sentry-prevent-cli_.*/i + includeNames: /^(sentry-prevent-|sentry_prevent_|codecov|codecov_)cli.*/i # - name: pypi diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4576d7f8..4e12b8ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -94,6 +94,9 @@ jobs: cd ../codecov-cli uv sync --no-binary-package pyyaml --no-binary-package ijson + - name: Run pre-build script + run: ./scripts/pre-build.sh + - name: Build with pyinstaller for ${{matrix.TARGET}} run: ${{matrix.CMD_BUILD}} @@ -158,7 +161,7 @@ jobs: path: ./prevent-cli/dist/sentry-prevent-cli_* package_artifacts: - # Craft requires one artifact named after the long commit sha of the release + # Craft requires one artifact named after the long commit sha of the release. name: Package assets for Craft runs-on: ubuntu-latest needs: [build_for_pypi, build_assets, build_linux_assets] @@ -166,10 +169,14 @@ jobs: - name: Download artifacts uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: - pattern: sentry-prevent-cli_* + pattern: "{sentry-prevent-,codecov-,codecov}cli*" - name: Upload release artifact uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: ${{ github.sha }} - path: sentry-prevent-cli_* + path: | + sentry-prevent-cli* + sentry-prevent-cli_wheel/* + codecovcli* + codecov-cli_wheel/* diff --git a/.github/workflows/release-codecov-cli.yml b/.github/workflows/release-codecov-cli.yml index aefa45cf..a2b2e274 100644 --- a/.github/workflows/release-codecov-cli.yml +++ b/.github/workflows/release-codecov-cli.yml @@ -1,5 +1,5 @@ -# This workflow publishes the codecov-cli assets to PyPI, GitHub releases, and -# our GCS bucket when a release is created. +# This workflow publishes the codecov-cli assets to PyPI and our GCS bucket +# when a release is created. name: Build and publish codecov-cli on: @@ -10,8 +10,12 @@ permissions: contents: read jobs: + test: + runs-on: ubuntu-latest + steps: + - run: echo "hi from build and publish codecov-cli" + # publish_to_pypi: - # needs: build_for_pypi # permissions: # id-token: write # This is required for OIDC # runs-on: ubuntu-latest @@ -32,37 +36,8 @@ jobs: # verbose: true # packages-dir: codecov-cli/dist - publish_to_github: - runs-on: ubuntu-latest - steps: - - name: Download build artifacts - uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11 - with: - branch: release/${{ github.ref }} - name: codecov.* - name_is_regexp: true - path: codecov-cli/dist - - - name: Get auth token - id: token - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 - with: - app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} - private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} - - - name: Upload Release Asset - id: upload-release-asset - uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # v2.11.2 - with: - repo_token: ${{ steps.token.outputs.token }} - file_glob: true - file: ./codecov-cli/dist/* - tag: ${{ github.ref }} - overwrite: true - # publish_release: # name: Publish release - # needs: [build_assets, build_linux_assets, build_for_pypi, publish_to_pypi] # runs-on: ubuntu-latest # permissions: # contents: "read" diff --git a/scripts/build_alpine.sh b/scripts/build_alpine.sh index c3de7443..8c85f864 100755 --- a/scripts/build_alpine.sh +++ b/scripts/build_alpine.sh @@ -7,6 +7,7 @@ if sha256sum -c ./scripts/uv-installer-0.7.8.sha256sum; then sh uv-installer.sh; else echo "uv-installer failed checksum" && exit 1 fi +./scripts/pre-build.sh cd prevent-cli /root/.local/bin/uv python pin 3.9 # we need to build with python 3.9 to support systems with libpython >= 3.9 /root/.local/bin/uv sync diff --git a/scripts/build_linux.sh b/scripts/build_linux.sh index afd85c01..446596b6 100755 --- a/scripts/build_linux.sh +++ b/scripts/build_linux.sh @@ -3,6 +3,7 @@ set -eux apt update DEBIAN_FRONTEND=noninteractive apt install -y tzdata apt install -y python3.9 python3.9-dev python3-pip +./scripts/pre-build.sh cd prevent-cli python3.9 -m pip install uv --only-binary uv uv python pin 3.9 # we need to build with python 3.9 to support systems with libpython >= 3.9 diff --git a/scripts/pre-build.sh b/scripts/pre-build.sh new file mode 100755 index 00000000..77da30ae --- /dev/null +++ b/scripts/pre-build.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# this updates the editable property on the codecov-cli import in prevent-cli +# to be false. This is necessary for the pyinstaller build to work. +if [[ "$OSTYPE" == "darwin"* ]]; then + sed -i '' "s/editable\ =\ true/editable\ =\ false/g" prevent-cli/pyproject.toml +else + sed -i "s/editable\ =\ true/editable\ =\ false/g" prevent-cli/pyproject.toml +fi