mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-06 19:45:23 +00:00
chore(deb): release deb package for television (#31)
* chore(deb): release deb package for television * manually trigger cd workflow
This commit is contained in:
parent
06a4feb9f2
commit
900bfa50b9
76
.github/workflows/cd.yml
vendored
76
.github/workflows/cd.yml
vendored
@ -6,9 +6,15 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '[v]?[0-9]+.[0-9]+.[0-9]+'
|
- '[v]?[0-9]+.[0-9]+.[0-9]+'
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: 'Tag to deploy'
|
||||||
|
required: true
|
||||||
|
default: 'v0.0.0'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish-release:
|
||||||
|
|
||||||
name: Publishing for ${{ matrix.os }}
|
name: Publishing for ${{ matrix.os }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@ -137,3 +143,71 @@ jobs:
|
|||||||
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
publish-release-deb:
|
||||||
|
name: publish-release-deb
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
TARGET: x86_64-unknown-linux-musl
|
||||||
|
# Emit backtraces on panics.
|
||||||
|
RUST_BACKTRACE: 1
|
||||||
|
# Since we're distributing the dpkg, we don't know whether the user will
|
||||||
|
# have PCRE2 installed, so just do a static build.
|
||||||
|
PCRE2_SYS_STATIC: 1
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install packages (Ubuntu)
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if ! command -V sudo; then
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y --no-install-recommends sudo
|
||||||
|
fi
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y --no-install-recommends \
|
||||||
|
zsh xz-utils liblz4-tool musl-tools brotli zstd
|
||||||
|
|
||||||
|
- name: Install Rust
|
||||||
|
uses: dtolnay/rust-toolchain@master
|
||||||
|
with:
|
||||||
|
toolchain: nightly
|
||||||
|
target: ${{ env.TARGET }}
|
||||||
|
|
||||||
|
- name: Install cargo-deb
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cargo install cargo-deb
|
||||||
|
|
||||||
|
- name: Create deployment directory
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
dir=deployment/deb
|
||||||
|
mkdir -p "$dir"
|
||||||
|
echo "DEPLOY_DIR=$dir" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Build release binary
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cargo deb --profile deb --target ${{ env.TARGET }}
|
||||||
|
version="${GITHUB_REF/refs\/tags\//}"
|
||||||
|
echo "DEB_DIR=target/${{ env.TARGET }}/debian" >> $GITHUB_ENV
|
||||||
|
echo "DEB_NAME=television_$version-1_amd64.deb" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Create sha256 sum of deb file
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd "$DEB_DIR"
|
||||||
|
sum="$DEB_NAME.sha256"
|
||||||
|
shasum -a 256 "$DEB_NAME" > "$sum"
|
||||||
|
echo "SUM=$sum" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Upload release archive
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd "$DEB_DIR"
|
||||||
|
version="${GITHUB_REF/refs\/tags\//}"
|
||||||
|
gh release upload "$version" "$DEB_NAME" "$SUM"
|
||||||
|
@ -126,3 +126,7 @@ debug = true
|
|||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
lto = "thin"
|
lto = "thin"
|
||||||
|
|
||||||
|
[profile.deb]
|
||||||
|
inherits = "release"
|
||||||
|
debug = false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user