From 7e9c5b014c0c91fa34264b3105b8d3f7e4ee72b6 Mon Sep 17 00:00:00 2001 From: vyfor Date: Thu, 2 Jan 2025 22:31:38 +0500 Subject: [PATCH] chore: update semantic release --- .github/workflows/release.yml | 31 +++++++++++++++++++++---------- .releaserc.js | 12 +++--------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ce859ff4..14bc2978 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,8 @@ jobs: build: name: Build ${{ matrix.target }} runs-on: ${{ matrix.os }} - if: needs.get-next-version.outputs.new-release-published == 'true' + if: false + # if: needs.get-next-version.outputs.new-release-published == 'true' needs: - get-next-version strategy: @@ -112,18 +113,13 @@ jobs: release: runs-on: ubuntu-latest if: needs.get-next-version.outputs.new-release-published == 'true' - needs: [get-next-version, build] + # needs: [get-next-version, build] + needs: [get-next-version] steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - - - name: Download artifacts - uses: actions/download-artifact@v3 - with: - name: binaries - path: dist - name: Invoke semantic-release env: @@ -146,11 +142,26 @@ jobs: fetch-depth: 0 ref: client-server + - name: Set LuaRocks version + id: set_version + run: | + VERSION="${{ needs.get-next-version.outputs.new-release-version }}" + if [[ $VERSION == *"-beta"* ]]; then + # Convert 2.0.0-beta.1 to 2.0.0-beta-1 + BASE_VERSION=$(echo $VERSION | cut -d'-' -f1) + BETA_NUM=$(echo $VERSION | grep -oP '(?<=beta\.)\d+') + echo "version=${BASE_VERSION}-beta" >> $GITHUB_OUTPUT + echo "rockspec_revision=$BETA_NUM" >> $GITHUB_OUTPUT + else + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "rockspec_revision=1" >> $GITHUB_OUTPUT + fi + - uses: nvim-neorocks/luarocks-tag-release@v7 with: - # version: ${{ needs.get-next-version.outputs.new-release-version }} copy_directories: "plugin" - version: "scm" + version: ${{ steps.set_version.outputs.version }} + specrev: ${{ steps.set_version.outputs.rockspec_revision }} detailed_description: | Meet the future of rich presence with Cord, the most extensible Discord Rich Presence plugin for Neovim, powered by Rust. Cord offers a wide range of customization options allowing you to create custom and dynamic experiences that adapt to your needs. diff --git a/.releaserc.js b/.releaserc.js index 624f011b..8e58c35b 100644 --- a/.releaserc.js +++ b/.releaserc.js @@ -13,11 +13,9 @@ module.exports = { [ "@semantic-release/release-notes-generator", { - "preset": "conventionalcommits", + "preset": "angular", "writerOpts": { "headerPartial": "# {{#with context}}{{#if isServerUpdate}}⚙️ {{/if}}{{/with}}[{{currentTag}}]{{#if title}} {{title}}{{/if}}\n\n{{#if date}}_{{date}}_{{/if}}", - "commitPartial": "* {{subject}} ([{{hash}}]({{#if @root.repository}}{{@root.repository}}/commit/{{hash}}{{else}}{{@root.repoUrl}}/commit/{{hash}}{{/if}}))\n", - "mainTemplate": "{{> header}}\n\n{{#each commitGroups}}\n\n{{#if title}}\n### {{title}}\n\n{{/if}}{{#each commits}}{{> commit}}{{/each}}\n{{/each}}\n\n{{> footer}}", "transform": function (commit, context) { if (!context.context) context.context = {}; @@ -25,6 +23,7 @@ module.exports = { context.context.isServerUpdate = true; } + console.log(commit); const shortHash = commit.hash.substring(0, 7); return { @@ -42,12 +41,7 @@ module.exports = { } ], "@semantic-release/changelog", - [ - "@semantic-release/github", - { - "assets": "dist/*" - } - ], + "@semantic-release/github", [ "@semantic-release/git", {