ci: build binary on release

Upon release of a new version, automatically build a separate version of
pacdef for each backend that requires a feature flag. Attach all the
artifacts to the Github release.

Implemented by @thechubbypanda. Fixes #58. PR in #63.
This commit is contained in:
steven-omaha
2024-04-02 22:36:10 +02:00
+31
View File
@@ -0,0 +1,31 @@
name: release
on:
release:
types: [created]
jobs:
release:
name: release
runs-on: ubuntu-latest
container:
image: ghcr.io/archlinux/archlinux:base-devel
strategy:
matrix:
features: [default, arch, debian]
steps:
- name: Install dependencies
run: pacman -Syy --noconfirm rust apt git
- uses: actions/checkout@master
- name: Build
run: cargo build --release --features ${{ matrix.features }}
- name: Create temporary directory
run: mkdir pacdef-${{ matrix.features }}
- name: Copy artifacts to directory
run: cp -R target/release/pacdef man LICENSE README.md pacdef-${{ matrix.features }}
- name: Create archive from directory
run: tar czf pacdef-${{ matrix.features }}.tar.gz pacdef-${{ matrix.features }}
- name: Upload to release
uses: softprops/action-gh-release@v2
with:
files: pacdef-${{ matrix.features }}.tar.gz