From d9f785110240a0e402055359039fb5570fa802f1 Mon Sep 17 00:00:00 2001 From: Andy Ford Date: Fri, 2 Jul 2021 10:47:54 +0100 Subject: [PATCH] fix(semantic-release): add missing semantic release plugins --- .github/workflows/build.yml | 11 +++++++---- .github/workflows/plugin_version.ps1 | 2 +- package.json | 8 +++++++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f9c275c1d..8dd3e467b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,8 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@v2 + with: + persist-credentials: false # Environment things - name: Add Msbuild To PATH @@ -102,9 +104,10 @@ jobs: name: UKControllerPlugin.dll path: ".\\bin\\Release\\UKControllerPlugin.dll" - # If we're building on main, lets do a release' + # If we're building on main, lets do a release - name: Create Release if: github.ref == 'refs/heads/main' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npx -p @semantic-release/changelog -p semantic-release@17 semantic-release + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + GH_TOKEN: ${{ secrets.PAT }} + run: npx -p @semantic-release/changelog -p @semantic-release/git -p semantic-release@17 semantic-release diff --git a/.github/workflows/plugin_version.ps1 b/.github/workflows/plugin_version.ps1 index 0e36e2607..ec050be6f 100644 --- a/.github/workflows/plugin_version.ps1 +++ b/.github/workflows/plugin_version.ps1 @@ -2,7 +2,7 @@ Function Build-Version { # If we're on main, invoke semantic release to get the next version if (${env:GITHUB_REF} -eq "refs/heads/main") { - $semanticRelease = npx -p @semantic-release/changelog -p semantic-release@17 semantic-release --dry-run | Select-String -Pattern "Published release ((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)" + $semanticRelease = npx -p @semantic-release/changelog -p @semantic-release/git -p semantic-release@17 semantic-release --dry-run | Select-String -Pattern "Published release ((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)" if ($semanticRelease.Matches -eq $null) { return "non-release-build" diff --git a/package.json b/package.json index 3a94703ae..99e76e63f 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "@semantic-release/changelog", { "changelogFile": "docs/UserGuide/Changelog/Changelog.md", - "changelogTitle": "UK Controller Plugin Changelog" + "changelogTitle": "# UK Controller Plugin Changelog" } ], [ @@ -70,6 +70,12 @@ } ] } + ], + [ + "@semantic-release/git", + { + "assets": ["docs/UserGuide/Changelog/Changelog.md"] + } ] ] }