From 247dc5f0e42d58b9544c4687d86ebf0b100e553a Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 12:56:07 -0400 Subject: [PATCH 01/24] Adding builds for main and some reusable workflows --- .github/workflows/build_assets.yml | 84 ++++++++++++++++++++++ .github/workflows/build_for_pypi.yml | 41 +++++++++++ .github/workflows/build_main.yml | 17 +++++ .github/workflows/release_flow.yml | 102 ++++----------------------- 4 files changed, 155 insertions(+), 89 deletions(-) create mode 100644 .github/workflows/build_assets.yml create mode 100644 .github/workflows/build_for_pypi.yml create mode 100644 .github/workflows/build_main.yml diff --git a/.github/workflows/build_assets.yml b/.github/workflows/build_assets.yml new file mode 100644 index 00000000..c47841dd --- /dev/null +++ b/.github/workflows/build_assets.yml @@ -0,0 +1,84 @@ +name: Build and Optionally Publish to PyPi + +on: + workflow_call: + inputs: + release: + type: boolean + default: false + description: "Attach artifacts to a release" + +jobs: + name: Build packages + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + include: + - os: macos-latest + env: + CFLAGS: '-arch arm64 -arch x86_64' + TARGET: macos + CMD_REQS: > + mkdir -p pip-packages && cd pip-packages && pip wheel --no-cache-dir -r ../requirements.txt && cd .. + pip install --no-deps --no-index --find-links=pip-packages pip-packages/* + CMD_BUILD: > + STATICCODECOV_LIB_PATH=$(find build/ -maxdepth 1 -type d -name 'lib.*' -print -quit | xargs -I {} sh -c "find {} -type f -name 'staticcodecov*' -print -quit | sed 's|^./||'") && + pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --hidden-import staticcodecov_languages -F codecov_cli/main.py && + mv dist/main dist/codecovcli_macos && + lipo -archs dist/codecovcli_macos | grep -v 'x86_64 arm65' >> /dev/null && exit 1 + OUT_FILE_NAME: codecovcli_macos + ASSET_MIME: application/octet-stream + - os: ubuntu-20.04 + TARGET: ubuntu + CMD_REQS: > + pip install -r requirements.txt + CMD_BUILD: > + STATICCODECOV_LIB_PATH=$(find build/ -maxdepth 1 -type d -name 'lib.*' -print -quit | xargs -I {} sh -c "find {} -type f -name 'staticcodecov*' -print -quit | sed 's|^./||'") && + pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --hidden-import staticcodecov_languages -F codecov_cli/main.py && + cp ./dist/main ./dist/codecovcli_linux + OUT_FILE_NAME: codecovcli_linux + ASSET_MIME: application/octet-stream + - os: windows-latest + TARGET: windows + CMD_REQS: > + pip install -r requirements.txt + CMD_BUILD: > + pyinstaller --add-binary "build\lib.win-amd64-cpython-310\staticcodecov_languages.cp310-win_amd64.pyd;." --hidden-import staticcodecov_languages -F codecov_cli\main.py && + Copy-Item -Path ".\dist\main.exe" -Destination ".\dist\codecovcli_windows.exe" + OUT_FILE_NAME: codecovcli_windows.exe + ASSET_MIME: application/vnd.microsoft.portable-executable + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Set up Python 3.11 + uses: actions/setup-python@v3 + with: + python-version: "3.11" + - name: Install dependencies + run: | + ${{matrix.CMD_REQS}} + python setup.py build + - name: Install pyinstaller + run: pip install pyinstaller + - name: Build with pyinstaller for ${{matrix.TARGET}} + run: ${{matrix.CMD_BUILD}} + - name: Upload a Build Artifact + uses: actions/upload-artifact@v3.1.3 + if: inputs.release == false + with: + path: ./dist/${{ matrix.OUT_FILE_NAME }} + - name: Upload Release Asset + if: inputs.release == true + id: upload-release-asset + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ./dist/${{ matrix.OUT_FILE_NAME }} + asset_name: ${{ matrix.OUT_FILE_NAME }} + tag: ${{ github.ref }} + overwrite: true + + + diff --git a/.github/workflows/build_for_pypi.yml b/.github/workflows/build_for_pypi.yml new file mode 100644 index 00000000..05d9793e --- /dev/null +++ b/.github/workflows/build_for_pypi.yml @@ -0,0 +1,41 @@ +name: Build and Optionally Publish to PyPi + +on: + workflow_call: + inputs: + publish: + type: boolean + default: false + description: "Publish to PyPi" + +jobs: + build_for_pypi: + runs-on: ubuntu-latest + permissions: + id-token: write # This is required for requesting the JWT + contents: read # This is required for actions/checkout + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: "3.11" + - name: Install dependencies + run: | + pip install -r requirements.txt + python setup.py build + python setup.py develop + - name: Build distributions for different platforms + run: | + pip install wheel + python setup.py sdist bdist_wheel --plat-name=manylinux2014_x86_64 + python setup.py bdist_wheel --plat-name=macosx-12.6-x86_64 + python setup.py bdist_wheel --plat-name=win_amd64 + - name: Publish package to PyPi + if: inputs.publish == true + uses: pypa/gh-action-pypi-publish@release/v1 + + + diff --git a/.github/workflows/build_main.yml b/.github/workflows/build_main.yml new file mode 100644 index 00000000..57210f39 --- /dev/null +++ b/.github/workflows/build_main.yml @@ -0,0 +1,17 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Build-Test-Upload + +on: + push: + branches: + - main + +jobs: + build_and_publish_to_pipy: + uses: ./.github/workflows/build_for_pypi.yml + secrets: inherit + build_assets: + uses: ./.github/workflows/build_assets.yml + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/release_flow.yml b/.github/workflows/release_flow.yml index 64d65638..ad6891c8 100644 --- a/.github/workflows/release_flow.yml +++ b/.github/workflows/release_flow.yml @@ -1,110 +1,34 @@ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: Build-and-Release +name: Build and Publish CLI Release on: workflow_call: release: - types: created + types: + - created jobs: - build_and_publish_to_pipy: - runs-on: ubuntu-latest + build_and_publish_to_pypi: permissions: id-token: write # This is required for requesting the JWT contents: read # This is required for actions/checkout - steps: - - uses: actions/checkout@v3 - with: - submodules: true - - name: Set up Python 3.11 - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - name: Install dependencies - run: | - pip install -r requirements.txt - python setup.py build - python setup.py develop - - name: Build distributions for different platforms - run: | - pip install wheel - python setup.py sdist bdist_wheel --plat-name=manylinux2014_x86_64 - python setup.py bdist_wheel --plat-name=macosx-12.6-x86_64 - python setup.py bdist_wheel --plat-name=win_amd64 - - name: Publish package to PyPi - uses: pypa/gh-action-pypi-publish@release/v1 + uses: ./.github/workflows/build_for_pypi.yml + with: + publish: true + secrets: inherit buildassets: name: Build packages - runs-on: ${{ matrix.os }} - strategy: - fail-fast: true - matrix: - include: - - os: macos-latest - env: - CFLAGS: '-arch arm64 -arch x86_64' - TARGET: macos - CMD_REQS: > - mkdir -p pip-packages && cd pip-packages && pip wheel --no-cache-dir -r ../requirements.txt && cd .. - pip install --no-deps --no-index --find-links=pip-packages pip-packages/* - CMD_BUILD: > - STATICCODECOV_LIB_PATH=$(find build/ -maxdepth 1 -type d -name 'lib.*' -print -quit | xargs -I {} sh -c "find {} -type f -name 'staticcodecov*' -print -quit | sed 's|^./||'") && - pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --hidden-import staticcodecov_languages -F codecov_cli/main.py && - mv dist/main dist/codecovcli_macos && - lipo -archs dist/codecovcli_macos | grep -v 'x86_64 arm65' >> /dev/null && exit 1 - OUT_FILE_NAME: codecovcli_macos - ASSET_MIME: application/octet-stream - - os: ubuntu-20.04 - TARGET: ubuntu - CMD_REQS: > - pip install -r requirements.txt - CMD_BUILD: > - STATICCODECOV_LIB_PATH=$(find build/ -maxdepth 1 -type d -name 'lib.*' -print -quit | xargs -I {} sh -c "find {} -type f -name 'staticcodecov*' -print -quit | sed 's|^./||'") && - pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --hidden-import staticcodecov_languages -F codecov_cli/main.py && - cp ./dist/main ./dist/codecovcli_linux - OUT_FILE_NAME: codecovcli_linux - ASSET_MIME: application/octet-stream - - os: windows-latest - TARGET: windows - CMD_REQS: > - pip install -r requirements.txt - CMD_BUILD: > - pyinstaller --add-binary "build\lib.win-amd64-cpython-310\staticcodecov_languages.cp310-win_amd64.pyd;." --hidden-import staticcodecov_languages -F codecov_cli\main.py && - Copy-Item -Path ".\dist\main.exe" -Destination ".\dist\codecovcli_windows.exe" - OUT_FILE_NAME: codecovcli_windows.exe - ASSET_MIME: application/vnd.microsoft.portable-executable - steps: - - uses: actions/checkout@v3 - with: - submodules: true - - name: Set up Python 3.11 - uses: actions/setup-python@v3 - with: - python-version: "3.11" - - name: Install dependencies - run: | - ${{matrix.CMD_REQS}} - python setup.py build - - name: Install pyinstaller - run: pip install pyinstaller - - name: Build with pyinstaller for ${{matrix.TARGET}} - run: ${{matrix.CMD_BUILD}} - - name: Upload Release Asset - id: upload-release-asset - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ./dist/${{ matrix.OUT_FILE_NAME }} - asset_name: ${{ matrix.OUT_FILE_NAME }} - tag: ${{ github.ref }} - overwrite: true + uses: ./.github/workflows/build_assets.yml + with: + release: true + secrets: inherit publish_release: name: Publish release - needs: [buildassets, build_and_publish_to_pipy] + needs: [buildassets, build_and_publish_to_pypi] runs-on: ubuntu-latest permissions: contents: 'read' From 241084ff8919a84fe1257c84cc4a6bfdba87e60f Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 12:58:31 -0400 Subject: [PATCH 02/24] Adding builds for main and some reusable workflows --- .github/workflows/push_flow.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push_flow.yml b/.github/workflows/push_flow.yml index 9f2eaba9..d6e26247 100644 --- a/.github/workflows/push_flow.yml +++ b/.github/workflows/push_flow.yml @@ -9,7 +9,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install dependencies @@ -26,6 +26,9 @@ jobs: codecov-startup: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + with: + submodules: true - uses: actions/setup-python@v3 - name: Install CLI run: | From 9caff415d1da96a71a1f1d9508340e15cfdb1b95 Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 13:06:00 -0400 Subject: [PATCH 03/24] Adding builds for main and some reusable workflows --- .github/workflows/build_main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_main.yml b/.github/workflows/build_main.yml index 57210f39..0339cd32 100644 --- a/.github/workflows/build_main.yml +++ b/.github/workflows/build_main.yml @@ -7,6 +7,7 @@ on: push: branches: - main + - feature/main-builds jobs: build_and_publish_to_pipy: From 1097a361d8c3fc0f45be91c704b6bb22e8a3c671 Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 13:20:44 -0400 Subject: [PATCH 04/24] Fix syntax --- .github/workflows/build_assets.yml | 141 ++++++++++++------------ .github/workflows/create_release.yml | 2 +- .github/workflows/create_release_pr.yml | 2 +- 3 files changed, 73 insertions(+), 72 deletions(-) diff --git a/.github/workflows/build_assets.yml b/.github/workflows/build_assets.yml index c47841dd..c1e97ac0 100644 --- a/.github/workflows/build_assets.yml +++ b/.github/workflows/build_assets.yml @@ -9,76 +9,77 @@ on: description: "Attach artifacts to a release" jobs: - name: Build packages - runs-on: ${{ matrix.os }} - strategy: - fail-fast: true - matrix: - include: - - os: macos-latest - env: - CFLAGS: '-arch arm64 -arch x86_64' - TARGET: macos - CMD_REQS: > - mkdir -p pip-packages && cd pip-packages && pip wheel --no-cache-dir -r ../requirements.txt && cd .. - pip install --no-deps --no-index --find-links=pip-packages pip-packages/* - CMD_BUILD: > - STATICCODECOV_LIB_PATH=$(find build/ -maxdepth 1 -type d -name 'lib.*' -print -quit | xargs -I {} sh -c "find {} -type f -name 'staticcodecov*' -print -quit | sed 's|^./||'") && - pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --hidden-import staticcodecov_languages -F codecov_cli/main.py && - mv dist/main dist/codecovcli_macos && - lipo -archs dist/codecovcli_macos | grep -v 'x86_64 arm65' >> /dev/null && exit 1 - OUT_FILE_NAME: codecovcli_macos - ASSET_MIME: application/octet-stream - - os: ubuntu-20.04 - TARGET: ubuntu - CMD_REQS: > - pip install -r requirements.txt - CMD_BUILD: > - STATICCODECOV_LIB_PATH=$(find build/ -maxdepth 1 -type d -name 'lib.*' -print -quit | xargs -I {} sh -c "find {} -type f -name 'staticcodecov*' -print -quit | sed 's|^./||'") && - pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --hidden-import staticcodecov_languages -F codecov_cli/main.py && - cp ./dist/main ./dist/codecovcli_linux - OUT_FILE_NAME: codecovcli_linux - ASSET_MIME: application/octet-stream - - os: windows-latest - TARGET: windows - CMD_REQS: > - pip install -r requirements.txt - CMD_BUILD: > - pyinstaller --add-binary "build\lib.win-amd64-cpython-310\staticcodecov_languages.cp310-win_amd64.pyd;." --hidden-import staticcodecov_languages -F codecov_cli\main.py && - Copy-Item -Path ".\dist\main.exe" -Destination ".\dist\codecovcli_windows.exe" - OUT_FILE_NAME: codecovcli_windows.exe - ASSET_MIME: application/vnd.microsoft.portable-executable - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Set up Python 3.11 - uses: actions/setup-python@v3 - with: - python-version: "3.11" - - name: Install dependencies - run: | - ${{matrix.CMD_REQS}} - python setup.py build - - name: Install pyinstaller - run: pip install pyinstaller - - name: Build with pyinstaller for ${{matrix.TARGET}} - run: ${{matrix.CMD_BUILD}} - - name: Upload a Build Artifact - uses: actions/upload-artifact@v3.1.3 - if: inputs.release == false - with: - path: ./dist/${{ matrix.OUT_FILE_NAME }} - - name: Upload Release Asset - if: inputs.release == true - id: upload-release-asset - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ./dist/${{ matrix.OUT_FILE_NAME }} - asset_name: ${{ matrix.OUT_FILE_NAME }} - tag: ${{ github.ref }} - overwrite: true + build_assets: + name: Build packages + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + include: + - os: macos-latest + env: + CFLAGS: '-arch arm64 -arch x86_64' + TARGET: macos + CMD_REQS: > + mkdir -p pip-packages && cd pip-packages && pip wheel --no-cache-dir -r ../requirements.txt && cd .. + pip install --no-deps --no-index --find-links=pip-packages pip-packages/* + CMD_BUILD: > + STATICCODECOV_LIB_PATH=$(find build/ -maxdepth 1 -type d -name 'lib.*' -print -quit | xargs -I {} sh -c "find {} -type f -name 'staticcodecov*' -print -quit | sed 's|^./||'") && + pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --hidden-import staticcodecov_languages -F codecov_cli/main.py && + mv dist/main dist/codecovcli_macos && + lipo -archs dist/codecovcli_macos | grep -v 'x86_64 arm65' >> /dev/null && exit 1 + OUT_FILE_NAME: codecovcli_macos + ASSET_MIME: application/octet-stream + - os: ubuntu-20.04 + TARGET: ubuntu + CMD_REQS: > + pip install -r requirements.txt + CMD_BUILD: > + STATICCODECOV_LIB_PATH=$(find build/ -maxdepth 1 -type d -name 'lib.*' -print -quit | xargs -I {} sh -c "find {} -type f -name 'staticcodecov*' -print -quit | sed 's|^./||'") && + pyinstaller --add-binary ${STATICCODECOV_LIB_PATH}:. --hidden-import staticcodecov_languages -F codecov_cli/main.py && + cp ./dist/main ./dist/codecovcli_linux + OUT_FILE_NAME: codecovcli_linux + ASSET_MIME: application/octet-stream + - os: windows-latest + TARGET: windows + CMD_REQS: > + pip install -r requirements.txt + CMD_BUILD: > + pyinstaller --add-binary "build\lib.win-amd64-cpython-310\staticcodecov_languages.cp310-win_amd64.pyd;." --hidden-import staticcodecov_languages -F codecov_cli\main.py && + Copy-Item -Path ".\dist\main.exe" -Destination ".\dist\codecovcli_windows.exe" + OUT_FILE_NAME: codecovcli_windows.exe + ASSET_MIME: application/vnd.microsoft.portable-executable + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Set up Python 3.11 + uses: actions/setup-python@v3 + with: + python-version: "3.11" + - name: Install dependencies + run: | + ${{matrix.CMD_REQS}} + python setup.py build + - name: Install pyinstaller + run: pip install pyinstaller + - name: Build with pyinstaller for ${{matrix.TARGET}} + run: ${{matrix.CMD_BUILD}} + - name: Upload a Build Artifact + uses: actions/upload-artifact@v3.1.3 + if: inputs.release == false + with: + path: ./dist/${{ matrix.OUT_FILE_NAME }} + - name: Upload Release Asset + if: inputs.release == true + id: upload-release-asset + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ./dist/${{ matrix.OUT_FILE_NAME }} + asset_name: ${{ matrix.OUT_FILE_NAME }} + tag: ${{ github.ref }} + overwrite: true diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 1ba580cd..d8c78774 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -10,7 +10,7 @@ jobs: create-release: name: Tag Release ${{ github.head_ref }} if: ${{ github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/') && github.repository_owner == 'codecov' }} - uses: codecov/gha-workflows/.github/workflows/create-release.yml@v1.2.1 + uses: codecov/gha-workflows/.github/workflows/create-release.yml@v1.2.2 secrets: inherit release: diff --git a/.github/workflows/create_release_pr.yml b/.github/workflows/create_release_pr.yml index a765b8c4..b86f878a 100644 --- a/.github/workflows/create_release_pr.yml +++ b/.github/workflows/create_release_pr.yml @@ -10,5 +10,5 @@ on: jobs: create-release-pr: name: Create PR for Release ${{ github.event.inputs.versionName }} - uses: codecov/gha-workflows/.github/workflows/create-release-pr.yml@v1.2.1 + uses: codecov/gha-workflows/.github/workflows/create-release-pr.yml@v1.2.2 secrets: inherit \ No newline at end of file From 6065d64e838c6fb5368621c860080980e61df44e Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 14:45:37 -0400 Subject: [PATCH 05/24] Working on ci --- .github/workflows/{push_flow.yml => ci.yml} | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename .github/workflows/{push_flow.yml => ci.yml} (98%) diff --git a/.github/workflows/push_flow.yml b/.github/workflows/ci.yml similarity index 98% rename from .github/workflows/push_flow.yml rename to .github/workflows/ci.yml index d6e26247..309669d7 100644 --- a/.github/workflows/push_flow.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,10 @@ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: Build-Test-Upload +name: CLI CI -on: [push] # Run on any push event +on: + pull_request: jobs: lint: From d7a76b2558e57d2ce7183bdb364bccfea7c68528 Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 14:59:57 -0400 Subject: [PATCH 06/24] Working on ci --- .github/workflows/build_assets.yml | 2 +- .github/workflows/build_main.yml | 2 +- codecov_cli/__init__.py | 2 +- samples/inputs/sample_001.py | 18 +++++++++++++++--- samples/inputs/sample_002.py | 14 +++++++++++--- samples/inputs/sample_005.py | 17 ++++++++++------- setup.py | 2 +- 7 files changed, 40 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build_assets.yml b/.github/workflows/build_assets.yml index c1e97ac0..07ca8a4b 100644 --- a/.github/workflows/build_assets.yml +++ b/.github/workflows/build_assets.yml @@ -1,4 +1,4 @@ -name: Build and Optionally Publish to PyPi +name: Build Compiled Assets on: workflow_call: diff --git a/.github/workflows/build_main.yml b/.github/workflows/build_main.yml index 0339cd32..a5b4a713 100644 --- a/.github/workflows/build_main.yml +++ b/.github/workflows/build_main.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: Build-Test-Upload +name: Build on: push: diff --git a/codecov_cli/__init__.py b/codecov_cli/__init__.py index 66811369..1b21c381 100644 --- a/codecov_cli/__init__.py +++ b/codecov_cli/__init__.py @@ -1,4 +1,4 @@ import importlib.metadata -__version__ = importlib.metadata.version('codecov-cli') +__version__ = importlib.metadata.version("codecov-cli") diff --git a/samples/inputs/sample_001.py b/samples/inputs/sample_001.py index 6dcaa138..007cc1d1 100644 --- a/samples/inputs/sample_001.py +++ b/samples/inputs/sample_001.py @@ -15,7 +15,9 @@ def cachorro() -> int: and 1 > 0 ): print("yell") - print("au au",) + print( + "au au", + ) x = 0 while x < 100: if x > 2: @@ -23,8 +25,10 @@ def cachorro() -> int: for k in range(100): print(x) x += 1 + def inner_function(): return "b" + return 2 if lru_cache else 1 @@ -50,6 +54,7 @@ def ifsandbuts(input_data): return 2 return b + def forsandstuff(aaa): i = 0 while i < aaa: @@ -66,15 +71,22 @@ def forsandstuff(aaa): aaa += i return -def single_line(): return 1 -def comma_at_end(v,): +def single_line(): + return 1 + + +def comma_at_end( + v, +): print(v) + @lru_cache def decorated_function(simple: str): return 3 + # pokemon diff --git a/samples/inputs/sample_002.py b/samples/inputs/sample_002.py index be59a28d..6b8ee582 100644 --- a/samples/inputs/sample_002.py +++ b/samples/inputs/sample_002.py @@ -5,6 +5,7 @@ def simple_function(a, b, c, d, e, f, g, h, i, j, k): # assert a == b pass + def some_more_if_stuff(val): if val >= 100: val = val + 1 @@ -12,10 +13,16 @@ def some_more_if_stuff(val): val = val * 2 else: val = val - 1 - return val ** 2 + return val**2 + def single_line_minecraft(bb): - k = 3;bb.matrix_blocks.render(); import minecraft; minecraft.run() + k = 3 + bb.matrix_blocks.render() + import minecraft + + minecraft.run() + a = 3 print("It's me mario") @@ -28,8 +35,9 @@ def single_line_minecraft(bb): while c < 1: print("b") + def nested_conditionals(val): if val > 10: if val > 100: if val > 1000: - return 'large value' \ No newline at end of file + return "large value" diff --git a/samples/inputs/sample_005.py b/samples/inputs/sample_005.py index 9fec836c..0e5f82bf 100644 --- a/samples/inputs/sample_005.py +++ b/samples/inputs/sample_005.py @@ -7,29 +7,32 @@ # Random comment x = "some string" -y = 'some string' +y = "some string" w = """some string""" + def well_documented_function(a, b): - """ Returns the value of a + b, a - b and a * b - As a tuple, in that order + """Returns the value of a + b, a - b and a * b + As a tuple, in that order """ plus = a + b minus = a - b times = a * b return (plus, minus, times) + def less_documented_function(a, b): - """ Returns tuple(a + b, a - b, a * b)""" + """Returns tuple(a + b, a - b, a * b)""" return (a + b, a - b, a * b) + def commented_function(a, b): # Returns tuple(a + b, a - b, a * b) return (a + b, a - b, a * b) + class MyClass: - """ This is my class, not yours u.u - """ + """This is my class, not yours u.u""" def __init__(self) -> None: - self.owner = 'me' \ No newline at end of file + self.owner = "me" diff --git a/setup.py b/setup.py index 6d2ff51a..75148821 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name="codecov-cli", - version='0.3.7', + version="0.3.7", packages=find_packages(exclude=["contrib", "docs", "tests*"]), description="Codecov Command Line Interface", long_description=long_description, From c9ec935b67c409d8022fb8a00b4efc802e1608e9 Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 15:15:18 -0400 Subject: [PATCH 07/24] Fixing sample data --- codecov_cli/__init__.py | 1 - samples/inputs/sample_001.py | 11 +++-------- samples/inputs/sample_002.py | 10 +++------- samples/inputs/sample_005.py | 13 +++++++------ setup.py | 2 +- 5 files changed, 14 insertions(+), 23 deletions(-) diff --git a/codecov_cli/__init__.py b/codecov_cli/__init__.py index 1b21c381..9063141a 100644 --- a/codecov_cli/__init__.py +++ b/codecov_cli/__init__.py @@ -1,4 +1,3 @@ import importlib.metadata - __version__ = importlib.metadata.version("codecov-cli") diff --git a/samples/inputs/sample_001.py b/samples/inputs/sample_001.py index 007cc1d1..2eed3282 100644 --- a/samples/inputs/sample_001.py +++ b/samples/inputs/sample_001.py @@ -15,9 +15,7 @@ def cachorro() -> int: and 1 > 0 ): print("yell") - print( - "au au", - ) + print("au au",) x = 0 while x < 100: if x > 2: @@ -72,13 +70,10 @@ def forsandstuff(aaa): return -def single_line(): - return 1 +def single_line(): return 1 -def comma_at_end( - v, -): +def comma_at_end(v,): print(v) diff --git a/samples/inputs/sample_002.py b/samples/inputs/sample_002.py index 6b8ee582..a0560533 100644 --- a/samples/inputs/sample_002.py +++ b/samples/inputs/sample_002.py @@ -13,15 +13,11 @@ def some_more_if_stuff(val): val = val * 2 else: val = val - 1 - return val**2 + return val ** 2 def single_line_minecraft(bb): - k = 3 - bb.matrix_blocks.render() - import minecraft - - minecraft.run() + k = 3;bb.matrix_blocks.render(); import minecraft; minecraft.run() a = 3 @@ -40,4 +36,4 @@ def nested_conditionals(val): if val > 10: if val > 100: if val > 1000: - return "large value" + return 'large value' diff --git a/samples/inputs/sample_005.py b/samples/inputs/sample_005.py index 0e5f82bf..e0074428 100644 --- a/samples/inputs/sample_005.py +++ b/samples/inputs/sample_005.py @@ -7,13 +7,13 @@ # Random comment x = "some string" -y = "some string" +y = 'some string' w = """some string""" def well_documented_function(a, b): - """Returns the value of a + b, a - b and a * b - As a tuple, in that order + """ Returns the value of a + b, a - b and a * b + As a tuple, in that order """ plus = a + b minus = a - b @@ -22,7 +22,7 @@ def well_documented_function(a, b): def less_documented_function(a, b): - """Returns tuple(a + b, a - b, a * b)""" + """ Returns tuple(a + b, a - b, a * b)""" return (a + b, a - b, a * b) @@ -32,7 +32,8 @@ def commented_function(a, b): class MyClass: - """This is my class, not yours u.u""" + """This is my class, not yours u.u + """ def __init__(self) -> None: - self.owner = "me" + self.owner = 'me' diff --git a/setup.py b/setup.py index 75148821..0276840a 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ -from platform import system from os import path +from platform import system from setuptools import Extension, find_packages, setup From afe343aeaeb93cb41cf26191d34ac36e28662a6e Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 15:26:03 -0400 Subject: [PATCH 08/24] Fixing sample data --- samples/inputs/sample_001.py | 37 +++++++++++++++--------------------- samples/inputs/sample_002.py | 6 +----- samples/inputs/sample_005.py | 8 ++------ 3 files changed, 18 insertions(+), 33 deletions(-) diff --git a/samples/inputs/sample_001.py b/samples/inputs/sample_001.py index 2eed3282..746f143f 100644 --- a/samples/inputs/sample_001.py +++ b/samples/inputs/sample_001.py @@ -7,12 +7,12 @@ def cachorro() -> int: a = 1 a = 1 + 1 if ( - "a" - or "b" - or "c" - or "sdnajdjsadadsajdas" in "dsadnsadsadsaudauda" - or (True and False) - and 1 > 0 + "a" + or "b" + or "c" + or "sdnajdjsadadsajdas" in "dsadnsadsadsaudauda" + or (True and False) + and 1 > 0 ): print("yell") print("au au",) @@ -23,18 +23,16 @@ def cachorro() -> int: for k in range(100): print(x) x += 1 - def inner_function(): return "b" - return 2 if lru_cache else 1 class Super(object): def itsbanana(self): a = ( - "dsadusdhiuahdb abshdu huidahsu aks shabdh ada" - + "adbjab bsdab khdsb kbas bkasd a" + "dsadusdhiuahdb abshdu huidahsu aks shabdh ada" + + "adbjab bsdab khdsb kbas bkasd a" ) calculate(1, 2, "dsadsadsadsa", 56, "094329843432", [None] * 100) return 1 + 0 @@ -52,7 +50,6 @@ def ifsandbuts(input_data): return 2 return b - def forsandstuff(aaa): i = 0 while i < aaa: @@ -69,32 +66,28 @@ def forsandstuff(aaa): aaa += i return - def single_line(): return 1 - def comma_at_end(v,): print(v) - @lru_cache def decorated_function(simple: str): return 3 - # pokemon def unusual_function( - a: int, - commit: str, - smt: Optional[int], - should_ha: Super, - *, - upload: int, + a: int, + commit: str, + smt: Optional[int], + should_ha: Super, + *, + upload: int, ): return a + 1 print("here") -cachorro() +cachorro() \ No newline at end of file diff --git a/samples/inputs/sample_002.py b/samples/inputs/sample_002.py index a0560533..be59a28d 100644 --- a/samples/inputs/sample_002.py +++ b/samples/inputs/sample_002.py @@ -5,7 +5,6 @@ def simple_function(a, b, c, d, e, f, g, h, i, j, k): # assert a == b pass - def some_more_if_stuff(val): if val >= 100: val = val + 1 @@ -15,11 +14,9 @@ def some_more_if_stuff(val): val = val - 1 return val ** 2 - def single_line_minecraft(bb): k = 3;bb.matrix_blocks.render(); import minecraft; minecraft.run() - a = 3 print("It's me mario") try: @@ -31,9 +28,8 @@ def single_line_minecraft(bb): while c < 1: print("b") - def nested_conditionals(val): if val > 10: if val > 100: if val > 1000: - return 'large value' + return 'large value' \ No newline at end of file diff --git a/samples/inputs/sample_005.py b/samples/inputs/sample_005.py index e0074428..9fec836c 100644 --- a/samples/inputs/sample_005.py +++ b/samples/inputs/sample_005.py @@ -10,7 +10,6 @@ y = 'some string' w = """some string""" - def well_documented_function(a, b): """ Returns the value of a + b, a - b and a * b As a tuple, in that order @@ -20,20 +19,17 @@ def well_documented_function(a, b): times = a * b return (plus, minus, times) - def less_documented_function(a, b): """ Returns tuple(a + b, a - b, a * b)""" return (a + b, a - b, a * b) - def commented_function(a, b): # Returns tuple(a + b, a - b, a * b) return (a + b, a - b, a * b) - class MyClass: - """This is my class, not yours u.u + """ This is my class, not yours u.u """ def __init__(self) -> None: - self.owner = 'me' + self.owner = 'me' \ No newline at end of file From 658ae29d01da1bac2dd1b561d5a4673c6063d36b Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 15:33:36 -0400 Subject: [PATCH 09/24] Attempting input fix --- samples/inputs/sample_001.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/samples/inputs/sample_001.py b/samples/inputs/sample_001.py index 746f143f..6dcaa138 100644 --- a/samples/inputs/sample_001.py +++ b/samples/inputs/sample_001.py @@ -7,12 +7,12 @@ def cachorro() -> int: a = 1 a = 1 + 1 if ( - "a" - or "b" - or "c" - or "sdnajdjsadadsajdas" in "dsadnsadsadsaudauda" - or (True and False) - and 1 > 0 + "a" + or "b" + or "c" + or "sdnajdjsadadsajdas" in "dsadnsadsadsaudauda" + or (True and False) + and 1 > 0 ): print("yell") print("au au",) @@ -31,8 +31,8 @@ def inner_function(): class Super(object): def itsbanana(self): a = ( - "dsadusdhiuahdb abshdu huidahsu aks shabdh ada" - + "adbjab bsdab khdsb kbas bkasd a" + "dsadusdhiuahdb abshdu huidahsu aks shabdh ada" + + "adbjab bsdab khdsb kbas bkasd a" ) calculate(1, 2, "dsadsadsadsa", 56, "094329843432", [None] * 100) return 1 + 0 @@ -79,15 +79,15 @@ def decorated_function(simple: str): def unusual_function( - a: int, - commit: str, - smt: Optional[int], - should_ha: Super, - *, - upload: int, + a: int, + commit: str, + smt: Optional[int], + should_ha: Super, + *, + upload: int, ): return a + 1 print("here") -cachorro() \ No newline at end of file +cachorro() From 371694a9c16a03b087832b13ce6efbc0e2dee8ee Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 15:39:53 -0400 Subject: [PATCH 10/24] Attempting input fix --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 309669d7..6ade86bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,9 @@ name: CLI CI on: pull_request: + push: + branches: + - main jobs: lint: From 5bc4d7a9b3bf4382055aab2308ca4699b2f2c9ea Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 21:52:17 -0400 Subject: [PATCH 11/24] Fix --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ade86bb..a7387a9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: - python-version: "3.9" - python-version: "3.8" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true fetch-depth: 2 @@ -81,6 +81,10 @@ jobs: runs-on: ubuntu-latest needs: codecov-startup steps: + - uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 2 - uses: actions/setup-python@v3 - name: Install CLI run: | @@ -97,7 +101,7 @@ jobs: runs-on: ubuntu-latest needs: static-analysis steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true fetch-depth: 0 From 95a89429ea66692e81004b37be1b7b87f02d1acb Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 22:13:07 -0400 Subject: [PATCH 12/24] Fix --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7387a9c..4b0363bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,9 +30,6 @@ jobs: codecov-startup: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - with: - submodules: true - uses: actions/setup-python@v3 - name: Install CLI run: | From 63fc686661677c67e169ae9fc14bc9bb01e7c643 Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 22:14:32 -0400 Subject: [PATCH 13/24] Fix --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b0363bf..4151fcb7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,10 @@ jobs: codecov-startup: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 2 - uses: actions/setup-python@v3 - name: Install CLI run: | From 36ce089ed6c18acfefa50bf81783253e6abb7363 Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 22:57:17 -0400 Subject: [PATCH 14/24] Adding GPG signing for create release --- .github/workflows/ci.yml | 2 +- .github/workflows/create_release_pr.yml | 45 +++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4151fcb7..d6006669 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,7 +74,7 @@ jobs: - name: Test with pytest run: | pytest --cov - - name: Dogfooding codecov-cli. Use codecov-cli to upload to codecov (new upload endpoint) + - name: Dogfooding codecov-cli run: | codecovcli do-upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} diff --git a/.github/workflows/create_release_pr.yml b/.github/workflows/create_release_pr.yml index b86f878a..700350b8 100644 --- a/.github/workflows/create_release_pr.yml +++ b/.github/workflows/create_release_pr.yml @@ -9,6 +9,45 @@ on: jobs: create-release-pr: - name: Create PR for Release ${{ github.event.inputs.versionName }} - uses: codecov/gha-workflows/.github/workflows/create-release-pr.yml@v1.2.2 - secrets: inherit \ No newline at end of file + name: Create PR + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Import GPG key + id: import-gpg + uses: crazy-max/ghaction-import-gpg@v6 + with: + gpg_private_key: ${{ secrets.RELEASER_GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.RELEASER_PASSPHRASE }} + git_user_signingkey: true + git_commit_gpgsign: true + +# - name: Initialize mandatory git config +# run: | +# git config --global user.name "${{ steps.import-gpg.outputs.email }}" +# git config --global user.email "${{ steps.import-gpg.outputs.name }}" +# git config --global commit.gpgsign true + - name: Create release branch + run: git checkout -b release/${{ github.event.inputs.versionName }} + - name: Update version file + id: make-commit + run: | + sed -i 's/version="[0-9]\.[0-9]\.[0-9]"/version="${{ github.event.inputs.versionName }}"/g' setup.py + git add setup.py + git commit -S --message "Prepare release ${{ github.event.inputs.versionName }}" + echo "commit=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" + - name: Push release branch + run: git push origin release/${{ github.event.inputs.versionName }} + - name: Create pull request into main + uses: thomaseizinger/create-pull-request@1.3.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + head: release/${{ github.event.inputs.versionName }} + base: ${{ inputs.mainBranch }} + title: Release ${{ github.event.inputs.versionName }} + reviewers: ${{ github.event.issue.user.login }} + body: | + Release PR for ${{ github.event.inputs.versionName }} + I've updated the version name and committed: ${{ steps.make-commit.outputs.commit }}. \ No newline at end of file From 55d040157804989f2be5845b845ad3301fe8c63b Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 23:06:10 -0400 Subject: [PATCH 15/24] Adding GPG signing for create release --- .github/workflows/create_release_pr.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/create_release_pr.yml b/.github/workflows/create_release_pr.yml index 700350b8..1a12c2aa 100644 --- a/.github/workflows/create_release_pr.yml +++ b/.github/workflows/create_release_pr.yml @@ -21,14 +21,14 @@ jobs: with: gpg_private_key: ${{ secrets.RELEASER_GPG_PRIVATE_KEY }} passphrase: ${{ secrets.RELEASER_PASSPHRASE }} - git_user_signingkey: true - git_commit_gpgsign: true -# - name: Initialize mandatory git config -# run: | -# git config --global user.name "${{ steps.import-gpg.outputs.email }}" -# git config --global user.email "${{ steps.import-gpg.outputs.name }}" -# git config --global commit.gpgsign true + - name: Initialize mandatory git config + run: | + git config --global user.name "${{ steps.import-gpg.outputs.email }}" + git config --global user.email "${{ steps.import-gpg.outputs.name }}" + git config --global commit.gpgsign true + git config --global user.signingkey "${{ steps.import-gpg.outputs.keyid }}" + gpg --list-secret-keys --keyid-format=long - name: Create release branch run: git checkout -b release/${{ github.event.inputs.versionName }} - name: Update version file From 11309addf05bd31aed741515ec4b87955c3283c9 Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 23:15:53 -0400 Subject: [PATCH 16/24] Adding GPG signing for create release --- .github/workflows/create_release_pr.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/create_release_pr.yml b/.github/workflows/create_release_pr.yml index 1a12c2aa..700350b8 100644 --- a/.github/workflows/create_release_pr.yml +++ b/.github/workflows/create_release_pr.yml @@ -21,14 +21,14 @@ jobs: with: gpg_private_key: ${{ secrets.RELEASER_GPG_PRIVATE_KEY }} passphrase: ${{ secrets.RELEASER_PASSPHRASE }} + git_user_signingkey: true + git_commit_gpgsign: true - - name: Initialize mandatory git config - run: | - git config --global user.name "${{ steps.import-gpg.outputs.email }}" - git config --global user.email "${{ steps.import-gpg.outputs.name }}" - git config --global commit.gpgsign true - git config --global user.signingkey "${{ steps.import-gpg.outputs.keyid }}" - gpg --list-secret-keys --keyid-format=long +# - name: Initialize mandatory git config +# run: | +# git config --global user.name "${{ steps.import-gpg.outputs.email }}" +# git config --global user.email "${{ steps.import-gpg.outputs.name }}" +# git config --global commit.gpgsign true - name: Create release branch run: git checkout -b release/${{ github.event.inputs.versionName }} - name: Update version file From 7d5046b34bd1ddf25f0678004408387452eb5a42 Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 23:18:24 -0400 Subject: [PATCH 17/24] Adding GPG signing for create release --- .github/workflows/create_release_pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/create_release_pr.yml b/.github/workflows/create_release_pr.yml index 700350b8..358c69ce 100644 --- a/.github/workflows/create_release_pr.yml +++ b/.github/workflows/create_release_pr.yml @@ -34,6 +34,7 @@ jobs: - name: Update version file id: make-commit run: | + export GPG_TTY=$(tty) sed -i 's/version="[0-9]\.[0-9]\.[0-9]"/version="${{ github.event.inputs.versionName }}"/g' setup.py git add setup.py git commit -S --message "Prepare release ${{ github.event.inputs.versionName }}" From 16ed5cf3897b48d75ed37db85318d95e12d5e25c Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 23:36:24 -0400 Subject: [PATCH 18/24] Adding GPG signing for create release --- .github/workflows/create_release_pr.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create_release_pr.yml b/.github/workflows/create_release_pr.yml index 358c69ce..32542293 100644 --- a/.github/workflows/create_release_pr.yml +++ b/.github/workflows/create_release_pr.yml @@ -14,7 +14,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - + with: + persist-credentials: false - name: Import GPG key id: import-gpg uses: crazy-max/ghaction-import-gpg@v6 @@ -23,6 +24,7 @@ jobs: passphrase: ${{ secrets.RELEASER_PASSPHRASE }} git_user_signingkey: true git_commit_gpgsign: true + git_config_global: true # - name: Initialize mandatory git config # run: | @@ -33,8 +35,13 @@ jobs: run: git checkout -b release/${{ github.event.inputs.versionName }} - name: Update version file id: make-commit + env: + GITHUB_TOKEN: ${{ secrets.CODECOV_RELEASE_PAT }} + GIT_AUTHOR_NAME: ${{ steps.import-gpg.outputs.name }} + GIT_AUTHOR_EMAIL: ${{ steps.import-gpg.outputs.email }} + GIT_COMMITTER_NAME: ${{ steps.import-gpg.outputs.name }} + GIT_COMMITTER_EMAIL: ${{ steps.import-gpg.outputs.email }} run: | - export GPG_TTY=$(tty) sed -i 's/version="[0-9]\.[0-9]\.[0-9]"/version="${{ github.event.inputs.versionName }}"/g' setup.py git add setup.py git commit -S --message "Prepare release ${{ github.event.inputs.versionName }}" From 6d5566e3e7f541c151d2b2f23e6f4cacdd9dde27 Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 23:54:09 -0400 Subject: [PATCH 19/24] Adding GPG signing for create release --- .github/workflows/create_release_pr.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/create_release_pr.yml b/.github/workflows/create_release_pr.yml index 32542293..d920c0c8 100644 --- a/.github/workflows/create_release_pr.yml +++ b/.github/workflows/create_release_pr.yml @@ -21,16 +21,10 @@ jobs: uses: crazy-max/ghaction-import-gpg@v6 with: gpg_private_key: ${{ secrets.RELEASER_GPG_PRIVATE_KEY }} - passphrase: ${{ secrets.RELEASER_PASSPHRASE }} git_user_signingkey: true git_commit_gpgsign: true git_config_global: true -# - name: Initialize mandatory git config -# run: | -# git config --global user.name "${{ steps.import-gpg.outputs.email }}" -# git config --global user.email "${{ steps.import-gpg.outputs.name }}" -# git config --global commit.gpgsign true - name: Create release branch run: git checkout -b release/${{ github.event.inputs.versionName }} - name: Update version file From 1f22c016f0e28110e6cd79bb56ff4641752681de Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Thu, 5 Oct 2023 23:56:39 -0400 Subject: [PATCH 20/24] Adding GPG signing for create release --- .github/workflows/create_release_pr.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create_release_pr.yml b/.github/workflows/create_release_pr.yml index d920c0c8..588b3e06 100644 --- a/.github/workflows/create_release_pr.yml +++ b/.github/workflows/create_release_pr.yml @@ -27,7 +27,8 @@ jobs: - name: Create release branch run: git checkout -b release/${{ github.event.inputs.versionName }} - - name: Update version file + + - name: Update version and push id: make-commit env: GITHUB_TOKEN: ${{ secrets.CODECOV_RELEASE_PAT }} @@ -40,14 +41,14 @@ jobs: git add setup.py git commit -S --message "Prepare release ${{ github.event.inputs.versionName }}" echo "commit=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" - - name: Push release branch - run: git push origin release/${{ github.event.inputs.versionName }} + git push origin release/${{ github.event.inputs.versionName }} + - name: Create pull request into main uses: thomaseizinger/create-pull-request@1.3.1 with: github_token: ${{ secrets.GITHUB_TOKEN }} head: release/${{ github.event.inputs.versionName }} - base: ${{ inputs.mainBranch }} + base: main title: Release ${{ github.event.inputs.versionName }} reviewers: ${{ github.event.issue.user.login }} body: | From 1a8a33cf57cc7aefee7bfe6d312cc247dcf0216b Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Fri, 6 Oct 2023 00:03:25 -0400 Subject: [PATCH 21/24] Adding GPG signing for create release --- .github/workflows/create_release_pr.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/create_release_pr.yml b/.github/workflows/create_release_pr.yml index 588b3e06..a962be85 100644 --- a/.github/workflows/create_release_pr.yml +++ b/.github/workflows/create_release_pr.yml @@ -14,8 +14,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - persist-credentials: false + - name: Import GPG key id: import-gpg uses: crazy-max/ghaction-import-gpg@v6 @@ -30,12 +29,6 @@ jobs: - name: Update version and push id: make-commit - env: - GITHUB_TOKEN: ${{ secrets.CODECOV_RELEASE_PAT }} - GIT_AUTHOR_NAME: ${{ steps.import-gpg.outputs.name }} - GIT_AUTHOR_EMAIL: ${{ steps.import-gpg.outputs.email }} - GIT_COMMITTER_NAME: ${{ steps.import-gpg.outputs.name }} - GIT_COMMITTER_EMAIL: ${{ steps.import-gpg.outputs.email }} run: | sed -i 's/version="[0-9]\.[0-9]\.[0-9]"/version="${{ github.event.inputs.versionName }}"/g' setup.py git add setup.py From caff43cbdecc20d1717e7bacecc8aa05951166b4 Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Fri, 6 Oct 2023 00:07:25 -0400 Subject: [PATCH 22/24] Adding GPG signing for create release --- .github/workflows/create_release_pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/create_release_pr.yml b/.github/workflows/create_release_pr.yml index a962be85..0fb9a42f 100644 --- a/.github/workflows/create_release_pr.yml +++ b/.github/workflows/create_release_pr.yml @@ -23,6 +23,7 @@ jobs: git_user_signingkey: true git_commit_gpgsign: true git_config_global: true + git_committer_email: ${{ secrets.RELEASER_COMMITTER_EMAIL }} - name: Create release branch run: git checkout -b release/${{ github.event.inputs.versionName }} From fb916a0ae87b1a5d375e2d632cc85b2afee0a4ab Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Fri, 6 Oct 2023 00:10:43 -0400 Subject: [PATCH 23/24] Adding GPG signing for create release --- .github/workflows/create_release_pr.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/create_release_pr.yml b/.github/workflows/create_release_pr.yml index 0fb9a42f..a962be85 100644 --- a/.github/workflows/create_release_pr.yml +++ b/.github/workflows/create_release_pr.yml @@ -23,7 +23,6 @@ jobs: git_user_signingkey: true git_commit_gpgsign: true git_config_global: true - git_committer_email: ${{ secrets.RELEASER_COMMITTER_EMAIL }} - name: Create release branch run: git checkout -b release/${{ github.event.inputs.versionName }} From c1fdf3805eabe893cfd08c4ce93601ef17516f98 Mon Sep 17 00:00:00 2001 From: codecov-releaser Date: Fri, 6 Oct 2023 04:11:16 +0000 Subject: [PATCH 24/24] Prepare release 0.4.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0276840a..7c05c4fd 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name="codecov-cli", - version="0.3.7", + version="0.4.1", packages=find_packages(exclude=["contrib", "docs", "tests*"]), description="Codecov Command Line Interface", long_description=long_description,