mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-06 11:35:25 +00:00
chore(cd): fix cd configuration for deb packages
This commit is contained in:
parent
d50337b5c5
commit
e9dde70ecf
34
.github/workflows/cd.yml
vendored
34
.github/workflows/cd.yml
vendored
@ -8,15 +8,34 @@ on:
|
|||||||
- '[v]?[0-9]+.[0-9]+.[0-9]+'
|
- '[v]?[0-9]+.[0-9]+.[0-9]+'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
tag:
|
tags:
|
||||||
description: 'Tag to deploy'
|
description: 'Tags to deploy'
|
||||||
required: true
|
required: true
|
||||||
default: 'v0.0.0'
|
default: 'v0.0.0'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
create-release:
|
||||||
|
name: create-release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Get the release version from the tag
|
||||||
|
if: env.VERSION == ''
|
||||||
|
run: echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
|
||||||
|
- name: Show the version
|
||||||
|
run: |
|
||||||
|
echo "version is: $VERSION"
|
||||||
|
- name: Create GitHub release
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: gh release create $VERSION --draft --verify-tag --title $VERSION
|
||||||
|
outputs:
|
||||||
|
version: ${{ env.VERSION }}
|
||||||
|
|
||||||
publish-release:
|
publish-release:
|
||||||
|
|
||||||
name: Publishing for ${{ matrix.os }}
|
name: Publishing for ${{ matrix.os }}
|
||||||
|
needs: ['create-release']
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
@ -145,6 +164,7 @@ jobs:
|
|||||||
|
|
||||||
publish-release-deb:
|
publish-release-deb:
|
||||||
name: publish-release-deb
|
name: publish-release-deb
|
||||||
|
needs: ['create-release']
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
TARGET: x86_64-unknown-linux-musl
|
TARGET: x86_64-unknown-linux-musl
|
||||||
@ -181,6 +201,12 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
rustup target add x86_64-unknown-linux-musl
|
rustup target add x86_64-unknown-linux-musl
|
||||||
|
|
||||||
|
# for some reason, the above action doesn't seem to set the target correctly
|
||||||
|
- name: Add rustup target
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
rustup target add x86_64-unknown-linux-musl
|
||||||
|
|
||||||
- name: Install cargo-deb
|
- name: Install cargo-deb
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@ -197,7 +223,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cargo deb --profile deb --target ${{ env.TARGET }}
|
cargo deb --profile deb --target ${{ env.TARGET }}
|
||||||
version="${GITHUB_REF/refs\/tags\//}"
|
version="${{ needs.create-release.outputs.version }}"
|
||||||
echo "DEB_DIR=target/${{ env.TARGET }}/debian" >> $GITHUB_ENV
|
echo "DEB_DIR=target/${{ env.TARGET }}/debian" >> $GITHUB_ENV
|
||||||
echo "DEB_NAME=television_$version-1_amd64.deb" >> $GITHUB_ENV
|
echo "DEB_NAME=television_$version-1_amd64.deb" >> $GITHUB_ENV
|
||||||
|
|
||||||
@ -215,5 +241,5 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cd "$DEB_DIR"
|
cd "$DEB_DIR"
|
||||||
version="${GITHUB_REF/refs\/tags\//}"
|
version="${{ needs.create-release.outputs.version }}"
|
||||||
gh release upload "$version" "$DEB_NAME" "$SUM"
|
gh release upload "$version" "$DEB_NAME" "$SUM"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user