Skip to content

Commit

Permalink
ci: Update permissions to allow the workflow to modify GitHub Release…
Browse files Browse the repository at this point in the history
…s. (#40)

* ci: Update permissions to allow the workflow to modify GitHub Releases.

* build: Fix link to documentation in the toml file.

* build: Update link to changelog.

* ci: Update workflows to cancel previous runs unless the branch is the main branch.
  • Loading branch information
nfelt14 authored Oct 21, 2023
1 parent 8ca84fa commit 8c211c8
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 17 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/package-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
id: release
Expand Down Expand Up @@ -107,6 +109,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tek-repo-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
# Cancel running jobs for the same workflow and branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
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
Expand All @@ -33,7 +33,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: |
Expand All @@ -60,23 +60,23 @@ jobs:
- name: Test
run: tox -ve tests
- uses: actions/upload-artifact@v3
if: '!cancelled()'
if: ${{ !cancelled() }}
with:
name: artifact_${{ matrix.os_name }}_tests
path: |
.results_*/**
.coverage*
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: '!cancelled()'
if: ${{ !cancelled() }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./.coverage_tests.xml
name: codecov-${{ matrix.os_name }}
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:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
# Cancel running jobs for the same workflow and branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
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)
Expand Down Expand Up @@ -36,19 +36,19 @@ jobs:
- name: Test
run: tox -ve ${{ matrix.tox_env }}
- uses: thedoctor0/[email protected]
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:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 = ["_"]
Expand Down

0 comments on commit 8c211c8

Please sign in to comment.