From f6d7004d7acfd003ceb5053d7522f2998ec90e08 Mon Sep 17 00:00:00 2001 From: iOSonntag Date: Sun, 24 Sep 2023 09:56:51 +0200 Subject: [PATCH] fix(ci): fixed a bug where the pipeline did not submit a release --- .github/workflows/release.yml | 50 ++++++++++++++++++----------------- .releaserc.js | 18 ++++++------- 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f373404..7d2576f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,34 +33,36 @@ jobs: - name: Print next version run: | + echo ${{ steps.chkVersion.outputs.NEXT_RELEASE_VERSION }} echo ${{ steps.chkVersion.outputs.NEXT_RELEASE_VERSION }} echo "The next version is ${{ steps.chkVersion.outputs.NEXT_RELEASE_VERSION && steps.chkVersion.outputs.NEXT_RELEASE_VERSION || 'N/A' }}" >> $GITHUB_STEP_SUMMARY - + + + - name: Update version files and create tag + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + VERSION=$(node -p "require('./package.json').version") + echo "Updating version files to $VERSION" + pnpm run version + git config user.name github-actions + git config user.email github-actions@github.com + git add . + git commit -am "chore(release): v${{ steps.chkVersion.outputs.NEXT_RELEASE_VERSION }} [skip ci]\n\n${{ steps.chkVersion.outputs.NEXT_RELEASE_NOTES }}" + git tag -a $VERSION -m "$VERSION" + git push origin $VERSION + + - name: Build plugin run: | - pnpm install pnpm run build - # - name: Update version files and create tag - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # run: | - # VERSION=$(node -p "require('./package.json').version") - # echo "Updating version files to $VERSION" - # pnpm run version - # git config user.name github-actions - # git config user.email github-actions@github.com - # git add . - # git commit -am "CI/CD: Updated version files to $VERSION" - # git tag -a $VERSION -m "$VERSION" - # git push origin $VERSION + - name: Create release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + VERSION=$(node -p "require('./package.json').version") - # - name: Create release - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # run: | - # VERSION=$(node -p "require('./package.json').version") - - # gh release create "$VERSION" \ - # --title="Release v$VERSION" \ - # main.js manifest.json styles.css \ No newline at end of file + gh release create "$VERSION" \ + --title="Release v$VERSION" \ + main.js manifest.json styles.css \ No newline at end of file diff --git a/.releaserc.js b/.releaserc.js index da852c3..fed166b 100644 --- a/.releaserc.js +++ b/.releaserc.js @@ -52,15 +52,15 @@ module.exports = { "populateVersion": "pnpm run version" } ], - [ - "@semantic-release/exec", - { - "populateVersion": "VERSION=$(node -p \"require('./package.json').version\")\n" + - "gh release create \"$VERSION\" \ - --title=\"Release v$VERSION\" \ - main.js manifest.json styles.css" - } - ], + // [ + // "@semantic-release/exec", + // { + // "populateVersion": "VERSION=$(node -p \"require('./package.json').version\")\n" + + // "gh release create \"$VERSION\" \ + // --title=\"Release v$VERSION\" \ + // main.js manifest.json styles.css" + // } + // ], // "@semantic-release/github", // { // "assets": [