Kyoo/.github/workflows/release.yml

117 lines
3.5 KiB
YAML

name: Release the application
on:
push:
branches:
- master
jobs:
build:
name: Build for ${{matrix.artifact}}
runs-on: ${{matrix.os}}
strategy:
matrix:
include:
- os: ubuntu-16.04 # We are using an old version of ubuntu to have an old libc version (forward compatibility exist but not backward)
runtime: linux-x64
artifact: linux
# - os: windows-latest
# runtime: win-x64
# artifact: windows
- os: macOS-latest
runtime: osx-x64
artifact: macos
steps:
- uses: actions/checkout@v1
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Build the app
run: dotnet publish -r ${{matrix.runtime}} -c Release -o dist Kyoo
- name: Compression output
shell: bash
run: |
assets=kyoo_${{matrix.artifact}}
if [[ "${{runner.os}}" == "Windows" ]]; then
cd dist && 7z a "../$assets.zip"
else
sudo chown root:root -R dist
tar -C dist -czf "$assets.tar.gz" .
fi
- uses: actions/upload-artifact@v2
with:
name: kyoo_${{matrix.artifact}}
path: |
*.zip
*.tar.gz
release:
name: Create debian, rpm & arch releases
runs-on: ubuntu-latest
needs: build
env:
description: "A media browser"
version: v0.0.1 #${{ github.ref }}
steps:
- uses: actions/checkout@v1
- uses: actions/download-artifact@v2
with:
name: kyoo_linux
path: artifact
- name: Unzip the published files.
run: mkdir dist && tar -C dist -xzf artifact/kyoo_linux.tar.gz
- name: Create the package structure
run: |
sudo mkdir -p pkg/usr/lib/
sudo mkdir -p pkg/DEBIAN
sudo cp -r --no-preserve ownership dist pkg/usr/lib/kyoo
sudo install -Dm 644 deployment/kyoo.service -t pkg/usr/lib/systemd/system/
sudo install -Dm 644 deployment/kyoo.sysusers pkg/usr/lib/sysusers.d/kyoo.conf
sudo install -Dm 644 deployment/kyoo.tmpfiles pkg/usr/lib/tmpfiles.d/kyoo.conf
sudo install -Dm 755 deployment/postinst -t pkg/DEBIAN/
- uses: jiro4989/build-deb-action@v2
with:
package: kyoo
package_root: pkg
maintainer: Zoe Roux
version: ${{env.version}}
depends: postgresql
arch: amd64
desc: ${{env.description}}
- name: Build rpm package
run: |
rpmbuild -bb --buildroot . --build-in-place deployment/kyoo.spec
tree -a
- name: Prepare arch package
run: |
mkdir deployment/output
mv deployment/PKGBUILD.github deployment/PKGBUILD
cp -a pkg/usr deployment/output/usr
- uses: edlanglois/pkgbuild-action@v1
id: makepkg
with:
pkgdir: deployment
namcapDisable: true
- uses: actions/upload-artifact@v2
with:
name: kyoo_rpm
path: |
./*.rpm
!./*-debuginfo-*.rpm
- uses: actions/upload-artifact@v2
with:
name: kyoo_debian
path: ./*.deb
- uses: actions/upload-artifact@v2
with:
name: kyoo_arch
path: ${{steps.makepkg.outputs.pkgfile0}}
# new-version:
# if: startsWith(github.ref, 'refs/tags/v')
# runs-on: ubuntu-latest