Skip to content

Commit 97b734e

Browse files
committed
ci: fix release.yml
1 parent 8824070 commit 97b734e

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,27 +148,28 @@ jobs:
148148

149149
- name: Check Server Version
150150
run: |
151+
CARGO_VERSION="${{ needs.get-next-version.outputs.new-release-version }}"
152+
151153
git checkout client-server
152154
git config --global user.name 'github-actions[bot]'
153155
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
154156
git add Cargo.toml Cargo.lock
155-
git commit -m "build: bump project version to $CARGO_VERSION [skip ci]"
157+
git commit -m "build: bump project version to $CARGO_VERSION [skip ci]" || echo "nothing to commit"
156158
157159
changes=$(git diff --name-only $(git describe --tags --abbrev=0)..HEAD -- src/)
158160
159161
if [ -n "$changes" ]; then
160-
CARGO_VERSION="${{ needs.get-next-version.outputs.new-release-version }}"
161162
SERVER_VERSION=$(cat .github/server-version.txt | tr -d '\n')
162163
if [ "$CARGO_VERSION" != "$SERVER_VERSION" ]; then
163164
echo "Server version needs to be updated"
164165
echo "$CARGO_VERSION" > .github/server-version.txt
165166
166167
git add .github/server-version.txt
167-
git commit -m "chore: update server version to $CARGO_VERSION [skip ci]"
168+
git commit -m "chore: update server version to $CARGO_VERSION [skip ci]" || echo "nothing to commit"
168169
fi
169170
fi
170171
171-
git push
172+
git push || echo "nothing to commit"
172173
173174
release:
174175
runs-on: ubuntu-latest
@@ -180,6 +181,23 @@ jobs:
180181
with:
181182
fetch-depth: 0
182183

184+
- name: Cache Cargo
185+
uses: actions/cache@v4
186+
id: cargo-cache
187+
with:
188+
path: |
189+
~/.cargo/bin/
190+
~/.cargo/registry/index/
191+
~/.cargo/registry/cache/
192+
~/.cargo/git/db/
193+
target/
194+
key: x86_64-unknown-linux-musl-cargo-${{ hashFiles('**/Cargo.lock') }}
195+
196+
- name: Install semantic-release-cargo
197+
uses: taiki-e/install-action@v2
198+
with:
199+
tool: semantic-release-cargo@2
200+
183201
- name: Download artifacts
184202
uses: actions/download-artifact@v3
185203
with:
@@ -195,6 +213,7 @@ jobs:
195213
npm install -g @semantic-release/changelog
196214
npm install -g @semantic-release/git
197215
npm install -g @semantic-release/github
216+
npm install -g @semantic-release/exec
198217
npm install -g @semantic-release-cargo/semantic-release-cargo
199218
npx semantic-release --repository-url https://github.com/vyfor/cord.nvim
200219
@@ -234,4 +253,4 @@ jobs:
234253
Cord offers a wide range of customization options allowing you to create custom and dynamic experiences that adapt to your needs.
235254
The possibilities are endless, and the only limit is your creativity!
236255
env:
237-
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
256+
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}

.releaserc.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ module.exports = {
2828
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
2929
}
3030
],
31-
["@semantic-release-cargo/semantic-release-cargo"],
3231
[
3332
"@semantic-release/exec",
3433
{
35-
"verifyConditionsCmd": "./semantic-release-cargo verify-conditions",
36-
"prepareCmd": "./semantic-release-cargo prepare ${nextRelease.version}",
37-
"publishCmd": "./semantic-release-cargo publish"
34+
"verifyConditionsCmd": "semantic-release-cargo verify-conditions",
35+
"publishCmd": "semantic-release-cargo publish"
3836
}
3937
]
4038
]

0 commit comments

Comments
 (0)