1717 steps :
1818 - uses : actions/checkout@v4
1919
20+ - name : Set Start Time
21+ id : set-time
22+ run : echo "start-time=$(date +%s)" >> $GITHUB_OUTPUT
23+
24+
2025 - name : Cache Cargo
2126 uses : actions/cache@v4
2227 id : cargo-cache
5863 new-release-published : ${{ steps.get-next-version.outputs.new-release-published }}
5964 new-release-version : ${{ steps.get-next-version.outputs.new-release-version }}
6065 new-release-git-tag : ${{ steps.get-next-version.outputs.new-release-git-tag }}
66+ start-time : ${{ steps.set-time.outputs.start-time }}
6167
6268 build :
6369 name : Build ${{ matrix.target }}
@@ -179,10 +185,14 @@ jobs:
179185 uses : actions/checkout@v4
180186 with :
181187 fetch-depth : 0
188+ persist-credentials : true
182189
183190 - name : Setup Git
184191 run : |
185192 git pull
193+ git fetch --tags --force
194+ git config --global user.name 'github-actions[bot]'
195+ git config --global user.email 'github-actions[bot]@users.noreply.github.com'
186196
187197 - name : Cache Cargo
188198 uses : actions/cache@v4
@@ -213,6 +223,7 @@ jobs:
213223 env :
214224 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
215225 CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
226+ RELEASE_TIMESTAMP : ${{ needs.get-next-version.outputs.start-time }}
216227 run : |
217228 git pull
218229 npm install -g semantic-release
@@ -224,68 +235,6 @@ jobs:
224235 npm install -g semantic-release-export-data
225236 npx semantic-release --repository-url https://github.com/vyfor/cord.nvim
226237
227- sync-server-version :
228- name : Sync Server Version Metadata
229- runs-on : ubuntu-latest
230- if : needs.get-next-version.outputs.new-release-published == 'true'
231- needs : [get-next-version, release, merge]
232- steps :
233- - name : Checkout
234- uses : actions/checkout@v4
235- with :
236- fetch-depth : 0
237-
238- - name : Setup Git
239- run : |
240- git pull
241-
242- - name : Install semantic-release-cargo
243- uses : taiki-e/install-action@v2
244- with :
245- tool : semantic-release-cargo@2
246-
247- - name : Update version metadata
248- env :
249- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
250- run : |
251- VERSION="${{ needs.get-next-version.outputs.new-release-version }}"
252-
253- git config --global user.name 'github-actions[bot]'
254- git config --global user.email 'github-actions[bot]@users.noreply.github.com'
255-
256- semantic-release-cargo prepare $VERSION
257- git add Cargo.toml Cargo.lock
258-
259- PREVIOUS_TAG=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`)
260-
261- if [ -z "$PREVIOUS_TAG" ]; then
262- echo "No previous tag found, assuming first release"
263- changes="true"
264- else
265- changes=$(git diff --name-only ${PREVIOUS_TAG}..v${VERSION} -- src/)
266- fi
267-
268- if [ -n "$changes" ]; then
269- API_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/v${VERSION}"
270- RESPONSE=$(curl -sS -H "Authorization: Bearer $GITHUB_TOKEN" "$API_URL")
271- TIMESTAMP=$(echo "$RESPONSE" | jq -r '[.assets[].updated_at] | min | if . then fromdate else empty end')
272-
273- if [ -z "$TIMESTAMP" ]; then
274- echo "No release assets found for v${VERSION}"
275- exit 1
276- fi
277-
278- echo "${VERSION}|${TIMESTAMP}" > .github/server-metadata.txt
279- git add .github/server-metadata.txt
280- fi
281-
282- if git diff --cached --quiet; then
283- echo "nothing to commit"
284- else
285- git commit -m "chore: release ${VERSION} [skip ci]"
286- git push
287- fi
288-
289238 luarocks :
290239 name : LuaRocks Publish
291240 runs-on : ubuntu-latest
0 commit comments