Skip to content

Commit

Permalink
ci(actions): support creating package for Debian/Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
xrelkd committed Dec 17, 2023
1 parent ff05d5c commit 824e92e
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ defaults:
run:
shell: bash

env:
MAINTAINER: "xrelkd <46590321+xrelkd@users.noreply.github.com>"
PACKAGE_NAME: "clipcat"
PACKAGE_DESCRIPTION: "Clipboard manager written in Rust Programming Language"

jobs:
all:
name: Release
Expand All @@ -24,14 +29,17 @@ jobs:

include:
- target: aarch64-unknown-linux-musl
arch: arm64
os: ubuntu-latest
target_rustflags: "--codegen linker=aarch64-linux-gnu-gcc"

- target: armv7-unknown-linux-musleabihf
arch: armhf
os: ubuntu-latest
target_rustflags: "--codegen linker=arm-linux-gnueabihf-gcc"

- target: x86_64-unknown-linux-musl
arch: amd64
os: ubuntu-latest
target_rustflags: ""

Expand Down Expand Up @@ -79,7 +87,30 @@ jobs:
run: ./dev-support/bin/create-package
shell: bash

- name: Publish Archive
- name: Prepare Debian Package
env:
TARGET: ${{ matrix.target }}
REF: ${{ github.ref }}
OS: ${{ matrix.os }}
ARCH: ${{ matrix.arch }}
TARGET_RUSTFLAGS: ${{ matrix.target_rustflags }}
run: ./dev-support/bin/prepare-deb-package
if: ${{ matrix.arch == 'amd64' }}
shell: bash

- name: Create Debian Package
id: debian-package
uses: jiro4989/build-deb-action@v3
if: ${{ matrix.arch == 'amd64' }}
with:
package: ${{ env.PACKAGE_NAME }}
package_root: debian
maintainer: ${{ env.MAINTAINER }}
version: ${{ github.ref }}
arch: ${{ matrix.arch }}
desc: ${{ env.PACKAGE_DESCRIPTION }}

- name: Publish Package Archive
uses: softprops/action-gh-release@v1
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
Expand All @@ -88,3 +119,13 @@ jobs:
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish Debian Package
uses: softprops/action-gh-release@v1
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.arch == 'amd64' }}
with:
draft: false
files: ${{ steps.debian-package.outputs.file_name }}
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 824e92e

Please sign in to comment.