From b5fbe8d4b949dc6443ac6abdfa9418b2237d0ceb Mon Sep 17 00:00:00 2001 From: Nicholas Felt Date: Fri, 20 Oct 2023 15:27:28 -0700 Subject: [PATCH 1/7] ci: Update permissions to allow the workflow to modify GitHub Releases. --- .github/workflows/package-release.yml | 1 + CHANGELOG.md | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml index e942b3bf..e91f4965 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -107,6 +107,7 @@ jobs: runs-on: ubuntu-latest permissions: id-token: write + contents: write steps: - uses: actions/checkout@v3 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 3591557c..e2796c4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,10 @@ ______________________________________________________________________ Things to be included in the next release go here. +### Fixed + +- Updated permissions for the release workflow to allow it to upload the distribution files to the GitHub Release + ______________________________________________________________________ ## v0.1.17 (2023-10-20) From 4dee1cf5bed13e302f74eab34699b585191aac25 Mon Sep 17 00:00:00 2001 From: Nicholas Felt Date: Fri, 20 Oct 2023 15:33:11 -0700 Subject: [PATCH 2/7] build: Fix link to documentation in the toml file. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ef9f2f80..810382aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,7 @@ classifiers = [ "Topic :: System :: Hardware :: Hardware Drivers" ] description = "Manage connections and interactions with Test & Measurement devices." -documentation = "https://tm_devices.readthedocs.io/en/stable/" +documentation = "https://tm-devices.readthedocs.io/en/latest/" homepage = "https://pypi.org/project/tm_devices/" keywords = [ "REST API", From 4e5ecf424cb82f004e570b40cd5875d96a4de84f Mon Sep 17 00:00:00 2001 From: Nicholas Felt Date: Fri, 20 Oct 2023 15:35:06 -0700 Subject: [PATCH 3/7] build: Update link to changelog. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 810382aa..8fbeec2f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -148,7 +148,7 @@ list-visa-resources = "tm_devices:print_available_visa_devices" [tool.poetry.urls] "Bug Tracker" = "https://github.com/tektronix/tm_devices/issues" -"Changelog" = "https://tm_devices.readthedocs.io/en/stable/CHANGELOG.html" +"Changelog" = "https://github.com/tektronix/tm_devices/blob/main/CHANGELOG.md" [tool.pylint.basic] good-names = ["_"] From 072636ed4678d69886f01cb9701eb9e47be0290f Mon Sep 17 00:00:00 2001 From: Nicholas Felt Date: Fri, 20 Oct 2023 15:39:32 -0700 Subject: [PATCH 4/7] ci: Remove concurrency from workflows to prevent badges from going red on the main readme. --- .github/workflows/package-build.yml | 4 ---- .github/workflows/test-code.yml | 4 ---- .github/workflows/test-docs.yml | 4 ---- 3 files changed, 12 deletions(-) diff --git a/.github/workflows/package-build.yml b/.github/workflows/package-build.yml index fdbd1996..7a57f9f4 100644 --- a/.github/workflows/package-build.yml +++ b/.github/workflows/package-build.yml @@ -6,10 +6,6 @@ on: tags: ['*'] pull_request: branches: [main] -# Cancel running jobs for the same workflow and branch. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true jobs: # Verify the package builds fine build-package: diff --git a/.github/workflows/test-code.yml b/.github/workflows/test-code.yml index 26ed1265..045bebc3 100644 --- a/.github/workflows/test-code.yml +++ b/.github/workflows/test-code.yml @@ -5,10 +5,6 @@ on: branches: [main] pull_request: branches: [main] -# Cancel running jobs for the same workflow and branch. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true # IMPORTANT: Any new jobs need to be added to the check-tests-passed job to ensure they correctly gate code changes jobs: # Basic testing & linting diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml index 27b2fdf2..8f49ead8 100644 --- a/.github/workflows/test-docs.yml +++ b/.github/workflows/test-docs.yml @@ -5,10 +5,6 @@ on: branches: [main] pull_request: branches: [main] -# Cancel running jobs for the same workflow and branch. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true # IMPORTANT: Any new jobs need to be added to the check-docs-passed job to ensure they correctly gate code changes jobs: # Test building the docs (html, linkcheck, doctest, coverage) From e90148b67e8f3782d84f9371699998cda2ecc897 Mon Sep 17 00:00:00 2001 From: Nicholas Felt Date: Fri, 20 Oct 2023 15:49:25 -0700 Subject: [PATCH 5/7] ci: Update release workflow to add the previous changelog each time it is copied. --- .github/workflows/package-release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml index e91f4965..3b12def3 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -40,7 +40,9 @@ jobs: - name: Check for unreleased entries in the Changelog run: python scripts/check_unreleased_changelog_items.py - name: Copy Changelog to template directory - run: cp CHANGELOG.md python_semantic_release_templates/.previous_changelog_for_template.md + run: | + cp CHANGELOG.md python_semantic_release_templates/.previous_changelog_for_template.md + git add python_semantic_release_templates/.previous_changelog_for_template.md - name: Python Semantic Release uses: python-semantic-release/python-semantic-release@v8.1.2 id: release From 173b73fca53d0898a550498f5956bae587954c8c Mon Sep 17 00:00:00 2001 From: Nicholas Felt Date: Fri, 20 Oct 2023 18:32:04 -0700 Subject: [PATCH 6/7] ci: Update workflows to cancel previous runs unless the branch is the main branch. --- .github/workflows/tek-repo-lint.yml | 2 +- .github/workflows/test-code.yml | 8 ++++---- .github/workflows/test-docs.yml | 10 +++++++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tek-repo-lint.yml b/.github/workflows/tek-repo-lint.yml index 8b092b77..31b3e909 100644 --- a/.github/workflows/tek-repo-lint.yml +++ b/.github/workflows/tek-repo-lint.yml @@ -100,7 +100,7 @@ jobs: run: echo codeql-analysis file does not exist! # Check that all jobs passed check-repo-lint-passed: - if: always() + if: ${{ !cancelled() }} needs: - check-for-codeowners-file - check-for-readme-file diff --git a/.github/workflows/test-code.yml b/.github/workflows/test-code.yml index 045bebc3..17179c8e 100644 --- a/.github/workflows/test-code.yml +++ b/.github/workflows/test-code.yml @@ -29,7 +29,7 @@ jobs: - name: Run tox run: tox -v - uses: actions/upload-artifact@v3 - if: '!cancelled()' + if: ${{ !cancelled() }} with: name: artifact_${{ matrix.platform }}_${{ matrix.python-version }}_tests_and_linting path: | @@ -56,7 +56,7 @@ jobs: - name: Test run: tox -ve tests - uses: actions/upload-artifact@v3 - if: '!cancelled()' + if: ${{ !cancelled() }} with: name: artifact_${{ matrix.os_name }}_tests path: | @@ -64,7 +64,7 @@ jobs: .coverage* - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 - if: '!cancelled()' + if: ${{ !cancelled() }} with: token: ${{ secrets.CODECOV_TOKEN }} files: ./.coverage_tests.xml @@ -72,7 +72,7 @@ jobs: fail_ci_if_error: true # Check that all jobs passed check-tests-passed: - if: always() + if: ${{ !cancelled() }} needs: [test-general, test-fast] runs-on: ubuntu-latest steps: diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml index 8f49ead8..2528762b 100644 --- a/.github/workflows/test-docs.yml +++ b/.github/workflows/test-docs.yml @@ -5,6 +5,10 @@ on: branches: [main] pull_request: branches: [main] +# Cancel running jobs for the same workflow and branch. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} # IMPORTANT: Any new jobs need to be added to the check-docs-passed job to ensure they correctly gate code changes jobs: # Test building the docs (html, linkcheck, doctest, coverage) @@ -32,19 +36,19 @@ jobs: - name: Test run: tox -ve ${{ matrix.tox_env }} - uses: thedoctor0/zip-release@0.7.1 - if: '!cancelled()' + if: ${{ !cancelled() }} with: type: zip filename: ${{ matrix.tox_env }}_results.zip path: .results_${{ matrix.tox_env }}/ - uses: actions/upload-artifact@v3 - if: '!cancelled()' + if: ${{ !cancelled() }} with: name: artifact_${{ matrix.tox_env }} path: ${{ matrix.tox_env }}_results.zip # Check that all jobs passed check-docs-passed: - if: always() + if: ${{ !cancelled() }} needs: [test-docs] runs-on: ubuntu-latest steps: From 384b654a60079d7148104ad5812e3473a9089547 Mon Sep 17 00:00:00 2001 From: Nicholas Felt Date: Fri, 20 Oct 2023 18:33:11 -0700 Subject: [PATCH 7/7] ci: Update workflows to cancel previous runs unless the branch is the main branch. --- .github/workflows/test-code.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-code.yml b/.github/workflows/test-code.yml index 17179c8e..18733a1d 100644 --- a/.github/workflows/test-code.yml +++ b/.github/workflows/test-code.yml @@ -5,6 +5,10 @@ on: branches: [main] pull_request: branches: [main] +# Cancel running jobs for the same workflow and branch. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} # IMPORTANT: Any new jobs need to be added to the check-tests-passed job to ensure they correctly gate code changes jobs: # Basic testing & linting