diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 0abb00f..c67274b 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -19,20 +19,30 @@ jobs: script: '.version' # Output raw strings, not JSON texts raw-output: true - - name: Create Tag - uses: actions/github-script@v3 - env: - TAG: ${{ steps.version.outputs.output }} + - name: 'Get Release Notes' + id: releaseNotes + uses: 'cloudposse/github-action-jq@main' with: - github-token: ${{ github.token }} - script: | - github.git.createRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}", - sha: context.sha - }) + input: 'release_notes.json' + # JQ query string + script: '.| to_entries[] | select(.key | startswith("${{ steps.version.outputs.output }}")) | .value' + # Output raw strings, not JSON texts + raw-output: true + - name: Tag the commit + run: | + next_version=${{ steps.version.outputs.output }} + git tag -a "$next_version" -m "Version $next_version" + git push --follow-tags - name: Build Package SDist run: python -m build --sdist - name: Build Package Wheel - run: python -m build --wheel \ No newline at end of file + run: python -m build --wheel + - name: Create release + id: create_release + uses: actions/create-release@latest + with: + tag_name: ${{ steps.version.outputs.output }} + release_name: Release ${{ steps.version.outputs.output }} + body: ${{ steps.releaseNotes.outputs.output }} + draft: false + prerelease: false \ No newline at end of file diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 1789b6c..ca802fa 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.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://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python -name: Python package +name: Python Testing on: push: @@ -32,7 +32,7 @@ jobs: # stop the build if there are Python syntax errors or undefined names flake8 ./geese --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 ./geese --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + flake8 ./geese --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --ignore=E1,E23,W503 - name: Test with pytest run: | - pytest tests/tests.py --doctest-modules --junitxml=junit/test-results.xml + pytest tests/tests.py --doctest-modules --junitxml=tests/results/junit-test-results.xml diff --git a/geese/knowledge/certificates.py b/geese/knowledge/certificates.py index 914c114..4c686b4 100644 --- a/geese/knowledge/certificates.py +++ b/geese/knowledge/certificates.py @@ -5,7 +5,7 @@ class Certificates(BaseKnowledge): - def __init__(self, leader, args=None, logger=None, group=None, fleet=None, **kwargs): + def __init__(self, leader, args=None, logger=None, group=None, fleet=None, **kwargs): super().__init__(leader, args, logger, **kwargs) self.obj_type = "certificates" self.endpoint = "system/certificates" diff --git a/package.json b/package.json index 1567374..a8190f0 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,8 @@ "build": "yarn wheel && yarn sdist", "wheel": "python3 -m build --wheel", "sdist": "python3 -m build --sdist", - "pip": "python -m pip install --upgrade -r ./requirements.txt" + "pip": "python -m pip install --upgrade -r ./requirements.txt", + "test": "pytest tests/tests.py --doctest-modules --junitxml=tests/results/junit-test-results.xml", + "flake": "flake8 ./geese --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --ignore=C901,E501,E722" } } \ No newline at end of file diff --git a/release_notes.json b/release_notes.json new file mode 100644 index 0000000..370a5f8 --- /dev/null +++ b/release_notes.json @@ -0,0 +1,3 @@ +{ + "1.1.2": "Initial Release to Public" +} \ No newline at end of file