ci(nightly): stamp each build with its commit
The version reads 19.0.0+git<commit time, UTC>.<sha>: later than the release it follows, earlier than the next, and ordered among nightlies.
This commit is contained in:
@@ -24,6 +24,7 @@ jobs:
|
|||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
outputs:
|
outputs:
|
||||||
sha: ${{ steps.commit.outputs.sha }}
|
sha: ${{ steps.commit.outputs.sha }}
|
||||||
|
version: ${{ steps.commit.outputs.version }}
|
||||||
steps:
|
steps:
|
||||||
# workflow_dispatch has a branch selector, but a Nightly run always means
|
# workflow_dispatch has a branch selector, but a Nightly run always means
|
||||||
# develop. Resolve it once so every target builds the identical commit
|
# develop. Resolve it once so every target builds the identical commit
|
||||||
@@ -36,13 +37,22 @@ jobs:
|
|||||||
- name: Record source commit
|
- name: Record source commit
|
||||||
id: commit
|
id: commit
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
sha=$(git rev-parse HEAD)
|
||||||
|
base=$(grep -m1 '^version = ' Cargo.toml | cut -d'"' -f2)
|
||||||
|
stamp=$(TZ=UTC git log -1 --format=%cd --date=format-local:%Y%m%d%H%M)
|
||||||
|
[[ "$base" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ && "$stamp" =~ ^[0-9]{12}$ ]]
|
||||||
|
echo "sha=$sha" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "version=$base+git$stamp.${sha:0:7}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
binaries:
|
binaries:
|
||||||
name: ${{ matrix.target }}
|
name: ${{ matrix.target }}
|
||||||
needs: source
|
needs: source
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
|
env:
|
||||||
|
SOULSEEK_RS_VERSION: ${{ needs.source.outputs.version }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -219,9 +229,11 @@ jobs:
|
|||||||
|
|
||||||
smoke-test:
|
smoke-test:
|
||||||
name: Install published nightly
|
name: Install published nightly
|
||||||
needs: publish
|
needs: [source, publish]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
|
env:
|
||||||
|
VERSION: ${{ needs.source.outputs.version }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -233,7 +245,7 @@ jobs:
|
|||||||
SOULSEEK_RS_INSTALL_DIR: ${{ runner.temp }}/curl-install
|
SOULSEEK_RS_INSTALL_DIR: ${{ runner.temp }}/curl-install
|
||||||
run: |
|
run: |
|
||||||
sh website/public/install.sh --nightly
|
sh website/public/install.sh --nightly
|
||||||
"$SOULSEEK_RS_INSTALL_DIR/soulseek-rs" --version
|
"$SOULSEEK_RS_INSTALL_DIR/soulseek-rs" --version | grep -F "$VERSION"
|
||||||
|
|
||||||
- name: Install with wget and no curl on PATH
|
- name: Install with wget and no curl on PATH
|
||||||
env:
|
env:
|
||||||
@@ -246,4 +258,5 @@ jobs:
|
|||||||
ln -s "$(command -v "$tool")" "$RUNNER_TEMP/wget-path/$tool"
|
ln -s "$(command -v "$tool")" "$RUNNER_TEMP/wget-path/$tool"
|
||||||
done
|
done
|
||||||
PATH="$RUNNER_TEMP/wget-path" /bin/sh website/public/install.sh --nightly
|
PATH="$RUNNER_TEMP/wget-path" /bin/sh website/public/install.sh --nightly
|
||||||
"$SOULSEEK_RS_INSTALL_DIR/soulseek-rs" --version
|
"$SOULSEEK_RS_INSTALL_DIR/soulseek-rs" --version | grep -F "$VERSION"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user