ci: attach .deb and .rpm packages to releases and nightlies
Built by nfpm from the static musl binaries, with the man page and the bash, zsh and fish completions. The names carry no version, so releases/latest/download/soulseek-rs-amd64.deb stays a working link; the nightly pair replaces itself on the rolling prerelease.
This commit is contained in:
@@ -105,6 +105,12 @@ jobs:
|
||||
dry-run: true
|
||||
dry-run-intended: true
|
||||
|
||||
- name: Build .deb and .rpm
|
||||
if: endsWith(matrix.target, '-musl')
|
||||
env:
|
||||
TARGET: ${{ matrix.target }}
|
||||
run: sh scripts/package-linux.sh "target/$TARGET/release/soulseek-rs" "$SOULSEEK_RS_VERSION" "$TARGET" . soulseek-rs-nightly
|
||||
|
||||
- name: Store packaged binary
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@@ -112,6 +118,8 @@ jobs:
|
||||
path: |
|
||||
${{ steps.package.outputs.tar || steps.package.outputs.zip }}
|
||||
${{ steps.package.outputs.sha256 }}
|
||||
soulseek-rs-nightly-*.deb
|
||||
soulseek-rs-nightly-*.rpm
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
|
||||
@@ -147,6 +155,10 @@ jobs:
|
||||
soulseek-rs-nightly-aarch64-apple-darwin.sha256
|
||||
soulseek-rs-nightly-x86_64-pc-windows-msvc.sha256
|
||||
soulseek-rs-nightly-aarch64-pc-windows-msvc.sha256
|
||||
soulseek-rs-nightly-amd64.deb
|
||||
soulseek-rs-nightly-arm64.deb
|
||||
soulseek-rs-nightly-x86_64.rpm
|
||||
soulseek-rs-nightly-aarch64.rpm
|
||||
)
|
||||
printf '%s\n' "${expected[@]}" | sort > "$RUNNER_TEMP/expected-assets"
|
||||
find dist -maxdepth 1 -type f -exec basename {} \; | sort > "$RUNNER_TEMP/actual-assets"
|
||||
@@ -234,6 +246,7 @@ jobs:
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
VERSION: ${{ needs.source.outputs.version }}
|
||||
DOWNLOAD: https://github.com/${{ github.repository }}/releases/download/nightly
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -260,3 +273,19 @@ jobs:
|
||||
PATH="$RUNNER_TEMP/wget-path" /bin/sh website/public/install.sh --nightly
|
||||
"$SOULSEEK_RS_INSTALL_DIR/soulseek-rs" --version | grep -F "$VERSION"
|
||||
|
||||
- name: Install the .deb
|
||||
run: |
|
||||
curl -fsSLO "$DOWNLOAD/soulseek-rs-nightly-amd64.deb"
|
||||
sudo apt-get install -y ./soulseek-rs-nightly-amd64.deb
|
||||
soulseek-rs --version | grep -F "$VERSION"
|
||||
dpkg -L soulseek-rs | grep -Fx /usr/share/man/man1/soulseek-rs.1.gz
|
||||
dpkg -L soulseek-rs | grep -Fx /usr/share/zsh/vendor-completions/_soulseek-rs
|
||||
|
||||
- name: Install the .rpm
|
||||
run: |
|
||||
docker run --rm fedora:latest sh -ec "
|
||||
dnf install -y '$DOWNLOAD/soulseek-rs-nightly-x86_64.rpm'
|
||||
soulseek-rs --version | grep -F '$VERSION'
|
||||
rpm -ql soulseek-rs | grep -Fx /usr/share/man/man1/soulseek-rs.1.gz
|
||||
rpm -ql soulseek-rs | grep -Fx /usr/share/zsh/site-functions/_soulseek-rs
|
||||
"
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
name: Packaging
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'Cargo.lock'
|
||||
- 'Cargo.toml'
|
||||
- 'packaging/**'
|
||||
- 'scripts/package-linux.sh'
|
||||
- 'soulseek-rs/src/cli.rs'
|
||||
- 'soulseek-rs/src/run.rs'
|
||||
- 'soulseek-rs/src/commands/**'
|
||||
- '.github/workflows/packaging.yml'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: packaging-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
VERSION: 0.0.0+git202601010000.0000000
|
||||
|
||||
jobs:
|
||||
packages:
|
||||
name: .deb and .rpm
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: x86_64-unknown-linux-musl
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Install musl toolchain
|
||||
run: sudo apt-get update && sudo apt-get install -y musl-tools
|
||||
|
||||
- name: Build the packages
|
||||
env:
|
||||
SOULSEEK_RS_VERSION: ${{ env.VERSION }}
|
||||
TARGET: x86_64-unknown-linux-musl
|
||||
run: |
|
||||
cargo build --locked --release --target "$TARGET" --package soulseek-rs
|
||||
sh scripts/package-linux.sh "target/$TARGET/release/soulseek-rs" "$VERSION" "$TARGET" . soulseek-rs-nightly
|
||||
|
||||
- name: Install the .deb
|
||||
run: |
|
||||
sudo apt-get install -y ./soulseek-rs-nightly-amd64.deb
|
||||
soulseek-rs --version | grep -F "$VERSION"
|
||||
dpkg -L soulseek-rs | grep -Fx /usr/share/man/man1/soulseek-rs.1.gz
|
||||
dpkg -L soulseek-rs | grep -Fx /usr/share/zsh/vendor-completions/_soulseek-rs
|
||||
|
||||
- name: Install the .rpm
|
||||
run: |
|
||||
docker run --rm -v "$PWD:/packages:ro" fedora:latest sh -ec "
|
||||
dnf install -y /packages/soulseek-rs-nightly-x86_64.rpm
|
||||
soulseek-rs --version | grep -F '$VERSION'
|
||||
rpm -ql soulseek-rs | grep -Fx /usr/share/man/man1/soulseek-rs.1.gz
|
||||
rpm -ql soulseek-rs | grep -Fx /usr/share/zsh/site-functions/_soulseek-rs
|
||||
"
|
||||
@@ -200,6 +200,16 @@ jobs:
|
||||
ref: refs/tags/${{ needs.release.outputs.tag }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and upload .deb and .rpm
|
||||
if: endsWith(matrix.target, '-musl') && hashFiles('scripts/package-linux.sh') != ''
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAG: ${{ needs.release.outputs.tag }}
|
||||
TARGET: ${{ matrix.target }}
|
||||
run: |
|
||||
sh scripts/package-linux.sh "target/$TARGET/release/soulseek-rs" "${TAG#v}" "$TARGET" dist
|
||||
gh release upload "$TAG" dist/* --clobber
|
||||
|
||||
# The tap regenerates its formula from whatever `gh release view` calls latest,
|
||||
# so it only needs a nudge once every archive and .sha256 is on the release —
|
||||
# hence `needs: binaries` rather than firing alongside it. The tap also polls
|
||||
|
||||
Reference in New Issue
Block a user