Skip to content

Commit

Permalink
chore: update semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
vyfor committed Jan 2, 2025
1 parent f253296 commit 7e9c5b0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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.
Expand Down
12 changes: 3 additions & 9 deletions .releaserc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@ 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 = {};

if (commit.scope === 'server') {
context.context.isServerUpdate = true;
}

console.log(commit);
const shortHash = commit.hash.substring(0, 7);

return {
Expand All @@ -42,12 +41,7 @@ module.exports = {
}
],
"@semantic-release/changelog",
[
"@semantic-release/github",
{
"assets": "dist/*"
}
],
"@semantic-release/github",
[
"@semantic-release/git",
{
Expand Down

0 comments on commit 7e9c5b0

Please sign in to comment.