From b4dd9737ed5a17f662960ab5c673c566230c08df Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Fri, 13 Dec 2024 17:58:50 +0100 Subject: [PATCH 01/12] Create update-project.yaml --- .github/workflows/update-project.yaml | 74 +++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/update-project.yaml diff --git a/.github/workflows/update-project.yaml b/.github/workflows/update-project.yaml new file mode 100644 index 0000000..ee738dd --- /dev/null +++ b/.github/workflows/update-project.yaml @@ -0,0 +1,74 @@ +name: Create new Tag + +concurrency: + group: ${{github.repository}}-update-tag + cancel-in-progress: false + +on: + workflow_dispatch: + inputs: + tag: + description: 'Tag to be created (when empty, it will be automatically computed)' + required: false + type: string + python: + description: 'Update pyproject.toml automatically' + required: false + type: boolean +jobs: + create-new-tag: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + token: ${{ secrets.REPO_PAT }} + fetch-depth: 0 + - name: 'Validate semver' + if: ${{ inputs.tag != '' }} + run: | + local regex='^([0-9]+)\.([0-9]+)\.([0-9]+)(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)?$' + + if [[ "$version" =~ $regex ]]; then + echo "${{ inputs.tag }} is a valid SemVer." + echo "NEWTAG=${{ inputs.tag }}" >> $GITHUB_ENV + else + echo "${{ inputs.tag }} is NOT a valid SemVer." + exit 1 + fi + - name: 'Get Previous tag' + id: previoustag + if: ${{ inputs.tag == '' }} + uses: "WyriHaximus/github-action-get-previous-tag@v1" + with: + fallback: 0.0.0 # Optional fallback tag to use when no tag can be found + - name: 'Get next minor version' + id: semvers + if: ${{ inputs.tag == '' }} + uses: "WyriHaximus/github-action-next-semvers@v1" + with: + version: ${{ steps.previoustag.outputs.tag }} + - name: 'Set tag' + if: ${{ inputs.tag == '' }} + run: | + echo "NEWTAG=${{ steps.semvers.outputs.patch }}" >> $GITHUB_ENV + - name: Commit tag changes + run: | + git config --global user.name 'Bot' + git config --global user.email 'bot@zaphiro.ch' + git commit -am "Automated tag changes [dependabot skip]" || echo "No changes to commit" + git push + - name: Test + run: echo $NEWTAG + # - name: Create New Tag + # run: | + # git tag -a "v${{ env.new_version }}" -m "Release v${{ env.new_version }}" + # git push origin "v${{ env.new_version }}" + + # - name: Publish Release + # uses: actions/create-release@v1 + # with: + # tag_name: "v${{ env.new_version }}" + # release_name: "Release v${{ env.new_version }}" + From 885424e5d24db44d91e43987d47cca3f35dcad07 Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Fri, 13 Dec 2024 18:01:18 +0100 Subject: [PATCH 02/12] Update update-project.yaml --- .github/workflows/update-project.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/update-project.yaml b/.github/workflows/update-project.yaml index ee738dd..c017833 100644 --- a/.github/workflows/update-project.yaml +++ b/.github/workflows/update-project.yaml @@ -5,6 +5,9 @@ concurrency: cancel-in-progress: false on: + pull_request: + branches: + - main workflow_dispatch: inputs: tag: From 9c5e8892bc066e412d91e5e7c3616c1cd9c43c01 Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Fri, 13 Dec 2024 18:02:14 +0100 Subject: [PATCH 03/12] Update update-project.yaml --- .github/workflows/update-project.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-project.yaml b/.github/workflows/update-project.yaml index c017833..49a6fc1 100644 --- a/.github/workflows/update-project.yaml +++ b/.github/workflows/update-project.yaml @@ -21,7 +21,7 @@ on: jobs: create-new-tag: runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' + #if: github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v4 with: From 1a0a7617cca2263e598e358552bdabc6c078015f Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Sun, 15 Dec 2024 12:27:37 +0100 Subject: [PATCH 04/12] test --- .github/workflows/update-project.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update-project.yaml b/.github/workflows/update-project.yaml index 49a6fc1..3ce6970 100644 --- a/.github/workflows/update-project.yaml +++ b/.github/workflows/update-project.yaml @@ -56,22 +56,26 @@ jobs: if: ${{ inputs.tag == '' }} run: | echo "NEWTAG=${{ steps.semvers.outputs.patch }}" >> $GITHUB_ENV + - name: 'Modify python project' + if: ${{ inputs.python }} + run: | + sed -i "s/version = \".*\"/version = \"$NEWTAG\"/g" pyproject.toml - name: Commit tag changes run: | git config --global user.name 'Bot' git config --global user.email 'bot@zaphiro.ch' - git commit -am "Automated tag changes [dependabot skip]" || echo "No changes to commit" - git push + #git commit -am "Automated tag changes [dependabot skip]" || echo "No changes to commit" + #git push - name: Test run: echo $NEWTAG # - name: Create New Tag # run: | - # git tag -a "v${{ env.new_version }}" -m "Release v${{ env.new_version }}" - # git push origin "v${{ env.new_version }}" + # git tag -a "v${{ env.NEWTAG }}" -m "Release v${{ env.NEWTAG }}" + # git push origin "v${{ env.NEWTAG }}" # - name: Publish Release # uses: actions/create-release@v1 # with: - # tag_name: "v${{ env.new_version }}" - # release_name: "Release v${{ env.new_version }}" + # tag_name: "v${{ env.NEWTAG }}" + # release_name: "Release v${{ env.NEWTAG }}" From bf9b6aa4c5413c63b528033c5a16aca6685ac95b Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Sun, 15 Dec 2024 12:28:34 +0100 Subject: [PATCH 05/12] test --- .github/workflows/update-project.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-project.yaml b/.github/workflows/update-project.yaml index 3ce6970..49c5c41 100644 --- a/.github/workflows/update-project.yaml +++ b/.github/workflows/update-project.yaml @@ -57,7 +57,7 @@ jobs: run: | echo "NEWTAG=${{ steps.semvers.outputs.patch }}" >> $GITHUB_ENV - name: 'Modify python project' - if: ${{ inputs.python }} + #if: ${{ inputs.python }} run: | sed -i "s/version = \".*\"/version = \"$NEWTAG\"/g" pyproject.toml - name: Commit tag changes From ed5401ee9bbc1858f69466963fbf15b1b127a49b Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Sun, 15 Dec 2024 12:30:45 +0100 Subject: [PATCH 06/12] Update update-project.yaml --- .github/workflows/update-project.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-project.yaml b/.github/workflows/update-project.yaml index 49c5c41..858b74c 100644 --- a/.github/workflows/update-project.yaml +++ b/.github/workflows/update-project.yaml @@ -57,7 +57,7 @@ jobs: run: | echo "NEWTAG=${{ steps.semvers.outputs.patch }}" >> $GITHUB_ENV - name: 'Modify python project' - #if: ${{ inputs.python }} + if: ${{ inputs.python }} run: | sed -i "s/version = \".*\"/version = \"$NEWTAG\"/g" pyproject.toml - name: Commit tag changes @@ -67,7 +67,7 @@ jobs: #git commit -am "Automated tag changes [dependabot skip]" || echo "No changes to commit" #git push - name: Test - run: echo $NEWTAG + run: echo "v${{ env.NEWTAG }}" # - name: Create New Tag # run: | # git tag -a "v${{ env.NEWTAG }}" -m "Release v${{ env.NEWTAG }}" From 2d30ea593d2e4698396268d449646a8caee0652e Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Sun, 15 Dec 2024 12:52:57 +0100 Subject: [PATCH 07/12] use external one --- .github/workflows/new-release.yaml | 23 ++++++++ .github/workflows/update-project.yaml | 81 --------------------------- 2 files changed, 23 insertions(+), 81 deletions(-) create mode 100644 .github/workflows/new-release.yaml delete mode 100644 .github/workflows/update-project.yaml diff --git a/.github/workflows/new-release.yaml b/.github/workflows/new-release.yaml new file mode 100644 index 0000000..327aa0d --- /dev/null +++ b/.github/workflows/new-release.yaml @@ -0,0 +1,23 @@ +name: Publish new release + +concurrency: + group: ${{github.repository}}-new-release + cancel-in-progress: false + +on: + workflow_dispatch: + inputs: + tag: + description: 'Tag to be created (when empty, it will be automatically computed)' + required: false + type: string + default: '' + +jobs: + create-new-tag: + uses: zaphiro-technologies/github-workflows/.github/workflows/new-release.yaml@new-release + secrets: inherit + with: + tag: ${{ inputs.tag }} + language: 'python' + diff --git a/.github/workflows/update-project.yaml b/.github/workflows/update-project.yaml deleted file mode 100644 index 858b74c..0000000 --- a/.github/workflows/update-project.yaml +++ /dev/null @@ -1,81 +0,0 @@ -name: Create new Tag - -concurrency: - group: ${{github.repository}}-update-tag - cancel-in-progress: false - -on: - pull_request: - branches: - - main - workflow_dispatch: - inputs: - tag: - description: 'Tag to be created (when empty, it will be automatically computed)' - required: false - type: string - python: - description: 'Update pyproject.toml automatically' - required: false - type: boolean -jobs: - create-new-tag: - runs-on: ubuntu-latest - #if: github.ref == 'refs/heads/main' - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - token: ${{ secrets.REPO_PAT }} - fetch-depth: 0 - - name: 'Validate semver' - if: ${{ inputs.tag != '' }} - run: | - local regex='^([0-9]+)\.([0-9]+)\.([0-9]+)(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)?$' - - if [[ "$version" =~ $regex ]]; then - echo "${{ inputs.tag }} is a valid SemVer." - echo "NEWTAG=${{ inputs.tag }}" >> $GITHUB_ENV - else - echo "${{ inputs.tag }} is NOT a valid SemVer." - exit 1 - fi - - name: 'Get Previous tag' - id: previoustag - if: ${{ inputs.tag == '' }} - uses: "WyriHaximus/github-action-get-previous-tag@v1" - with: - fallback: 0.0.0 # Optional fallback tag to use when no tag can be found - - name: 'Get next minor version' - id: semvers - if: ${{ inputs.tag == '' }} - uses: "WyriHaximus/github-action-next-semvers@v1" - with: - version: ${{ steps.previoustag.outputs.tag }} - - name: 'Set tag' - if: ${{ inputs.tag == '' }} - run: | - echo "NEWTAG=${{ steps.semvers.outputs.patch }}" >> $GITHUB_ENV - - name: 'Modify python project' - if: ${{ inputs.python }} - run: | - sed -i "s/version = \".*\"/version = \"$NEWTAG\"/g" pyproject.toml - - name: Commit tag changes - run: | - git config --global user.name 'Bot' - git config --global user.email 'bot@zaphiro.ch' - #git commit -am "Automated tag changes [dependabot skip]" || echo "No changes to commit" - #git push - - name: Test - run: echo "v${{ env.NEWTAG }}" - # - name: Create New Tag - # run: | - # git tag -a "v${{ env.NEWTAG }}" -m "Release v${{ env.NEWTAG }}" - # git push origin "v${{ env.NEWTAG }}" - - # - name: Publish Release - # uses: actions/create-release@v1 - # with: - # tag_name: "v${{ env.NEWTAG }}" - # release_name: "Release v${{ env.NEWTAG }}" - From d5f114dc52bfc072054ca4e8a4d4cf6f7ea610fa Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Sun, 15 Dec 2024 17:19:52 +0100 Subject: [PATCH 08/12] fix snyk ignore --- .snyk | 1 + 1 file changed, 1 insertion(+) diff --git a/.snyk b/.snyk index cac8bca..b6c6fdb 100644 --- a/.snyk +++ b/.snyk @@ -5,3 +5,4 @@ patch: {} exclude: global: - vendor/** + - examples/go/vendor From 7d53b2401f746ff377ab0e57bae0167c8fce48d5 Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Mon, 16 Dec 2024 09:27:48 +0100 Subject: [PATCH 09/12] Update .github/workflows/new-release.yaml --- .github/workflows/new-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/new-release.yaml b/.github/workflows/new-release.yaml index 327aa0d..36622a1 100644 --- a/.github/workflows/new-release.yaml +++ b/.github/workflows/new-release.yaml @@ -15,7 +15,7 @@ on: jobs: create-new-tag: - uses: zaphiro-technologies/github-workflows/.github/workflows/new-release.yaml@new-release + uses: zaphiro-technologies/github-workflows/.github/workflows/new-release.yaml@main secrets: inherit with: tag: ${{ inputs.tag }} From f5cd8aa995065470a3c34f9a26f8dd67fab3a75a Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Tue, 17 Dec 2024 16:55:03 +0100 Subject: [PATCH 10/12] use linkspector --- .github/config/.linkspector.yml | 16 ++++++++++++++++ .github/config/md-link-config.json | 13 ------------- .github/workflows/markdown.yaml | 2 +- 3 files changed, 17 insertions(+), 14 deletions(-) create mode 100644 .github/config/.linkspector.yml delete mode 100644 .github/config/md-link-config.json diff --git a/.github/config/.linkspector.yml b/.github/config/.linkspector.yml new file mode 100644 index 0000000..b42c35b --- /dev/null +++ b/.github/config/.linkspector.yml @@ -0,0 +1,16 @@ +# https://github.com/UmbrellaDocs/linkspector?tab=readme-ov-file#configuration +dirs: + - . +useGitIgnore: true +aliveStatusCodes: + - 200 + - 201 + - 204 + - 206 + - 429 +ignorePatterns: + - pattern: '^https://localhost' + - pattern: '^https://github.com/orgs/zaphiro-technologies/' + - pattern: '^https://github.com/zaphiro-technologies/' +excludedDirs: + - examples/go/vendor diff --git a/.github/config/md-link-config.json b/.github/config/md-link-config.json deleted file mode 100644 index d439e6d..0000000 --- a/.github/config/md-link-config.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "ignorePatterns": [ - { - "pattern": "^https://github.com/zaphiro-technologies/" - }, - { - "pattern": "^http://pkg.go.dev/" - }, - { - "pattern": "^https://www.typhoon-hil.com/" - } - ] -} diff --git a/.github/workflows/markdown.yaml b/.github/workflows/markdown.yaml index c5c8f85..1722862 100644 --- a/.github/workflows/markdown.yaml +++ b/.github/workflows/markdown.yaml @@ -8,7 +8,7 @@ on: jobs: markdown-checker: - uses: zaphiro-technologies/github-workflows/.github/workflows/markdown.yaml@main + uses: zaphiro-technologies/github-workflows/.github/workflows/markdown.yaml@131-feature-replace-link-checker-with-httpsgithubcomumbrelladocsaction-linkspector secrets: inherit with: md-lint-globs: | From ba02f79a9b1e70dbb0ab25f318bc30997c3690cf Mon Sep 17 00:00:00 2001 From: kwitekrac Date: Tue, 17 Dec 2024 18:51:42 +0000 Subject: [PATCH 11/12] docs(release_notes): update RELEASE_NOTES.md [dependabot skip] --- RELEASE_NOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 275013f..7797ae2 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -8,6 +8,7 @@ ### Continuous Integration +- Add `new-release` workflow (PR #76 by @chicco785) - Pass `-coverpkg=./...` to `go test` to compute coverage across all packages (PR #61 by @chicco785) From 145ef5a0719f327c26197efa6f1bda3f0b56fe5e Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Tue, 17 Dec 2024 21:01:52 +0100 Subject: [PATCH 12/12] Update .github/workflows/markdown.yaml --- .github/workflows/markdown.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/markdown.yaml b/.github/workflows/markdown.yaml index 1722862..c5c8f85 100644 --- a/.github/workflows/markdown.yaml +++ b/.github/workflows/markdown.yaml @@ -8,7 +8,7 @@ on: jobs: markdown-checker: - uses: zaphiro-technologies/github-workflows/.github/workflows/markdown.yaml@131-feature-replace-link-checker-with-httpsgithubcomumbrelladocsaction-linkspector + uses: zaphiro-technologies/github-workflows/.github/workflows/markdown.yaml@main secrets: inherit with: md-lint-globs: |