mirror of
https://github.com/house-of-vanity/mus-fuse.git
synced 2025-07-07 05:34:08 +00:00
121 lines
3.8 KiB
YAML
121 lines
3.8 KiB
YAML
name: Build and publish
|
|
on:
|
|
push:
|
|
# Sequence of patterns matched against refs/tags
|
|
tags:
|
|
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
|
|
|
jobs:
|
|
make_arch:
|
|
name: Build Arch Linux package
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: archlinux
|
|
options: --privileged
|
|
volumes:
|
|
- /sys/fs/cgroup:/sys/fs/cgroup
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Build Arch Linux package
|
|
uses: FFY00/build-arch-package@master
|
|
with:
|
|
PKGBUILD: $GITHUB_WORKSPACE/.github/workflows/PKGBUILD
|
|
OUTDIR: ./
|
|
- run: pwd
|
|
- run: ls -l
|
|
- run: mv ./*tar.xz mus-fuse-x86_64.tar.xz
|
|
- name: Upload Arch Package
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: mus-fuse-x86_64.tar.xz
|
|
path: ./mus-fuse-x86_64.tar.xz
|
|
|
|
make_bin:
|
|
name: Build binary
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
- name: Pre-build
|
|
run: sudo apt install -y libfuse-dev pkg-config
|
|
- uses: actions/checkout@v2
|
|
- name: Build binary
|
|
run: cargo build --release
|
|
- name: Upload binary
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: mus-fuse
|
|
path: ./target/release/mus-fuse
|
|
|
|
make_deb:
|
|
name: Make Deb package
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
- name: Pre-build
|
|
run: sudo apt install -y libfuse-dev pkg-config && cargo install cargo-deb
|
|
- uses: actions/checkout@v2
|
|
- name: Build deb
|
|
run: cargo deb --output ./target/debian/mus-fuse_amd64.deb
|
|
- name: Upload binary
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: mus-fuse_amd64.deb
|
|
path: ./target/debian/mus-fuse_amd64.deb
|
|
|
|
publish:
|
|
name: Publish release
|
|
needs: [make_bin, make_deb, make_arch]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Download binary
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: mus-fuse
|
|
- name: Download Arch Package
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: mus-fuse-x86_64.tar.xz
|
|
- name: Download Deb Package
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: mus-fuse_amd64.deb
|
|
- name: Create Release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
release_name: Release ${{ github.ref }}
|
|
draft: false
|
|
prerelease: false
|
|
- name: Upload Binary Release
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./mus-fuse/mus-fuse
|
|
asset_name: mus-fuse
|
|
asset_content_type: application/x-pie-executable;
|
|
- name: Upload Deb Release
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./mus-fuse/mus-fuse_amd64.deb
|
|
asset_name: mus-fuse_amd64.deb
|
|
asset_content_type: application/vnd.debian.binary-package;
|
|
- name: Upload Arch Linux Release
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./mus-fuse/mus-fuse-x86_64.tar.xz
|
|
asset_name: arch_linux_mus-fuse-x86_64.tar.xz
|
|
asset_content_type: application/x-xz;
|