mirror of
https://github.com/house-of-vanity/tmux-helper.git
synced 2026-02-04 01:37:57 +00:00
107 lines
3.1 KiB
YAML
107 lines
3.1 KiB
YAML
name: Build and publish
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
make_bin:
|
|
name: Build binary
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
include:
|
|
- os: ubuntu-latest
|
|
artifact_name: tmux-helper-linux
|
|
- os: macos-latest
|
|
artifact_name: tmux-helper-macos
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Pre-build (Linux only)
|
|
if: matrix.os == 'ubuntu-latest'
|
|
run: sudo apt install -y libdbus-1-dev pkg-config libdbus-1-3 libfuse-dev
|
|
|
|
- name: Build binary
|
|
run: cargo build --release
|
|
|
|
- name: Upload binary
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.artifact_name }}
|
|
path: ./target/release/tmux-helper
|
|
|
|
make_arch:
|
|
name: Make Arch Linux package
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: archlinux
|
|
options: --privileged
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Build Arch Linux package
|
|
uses: FFY00/build-arch-package@master
|
|
with:
|
|
PKGBUILD: $GITHUB_WORKSPACE/.github/workflows/PKGBUILD
|
|
OUTDIR: $HOME/arch-packages
|
|
- run: mv $HOME/arch-packages/*pkg.tar.zst tmux-helper-x86_64.pkg.tar.zst
|
|
- name: Upload Arch Package
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: arch_linux_tmux-helper-x86_64.pkg.tar.zst
|
|
path: ./tmux-helper-x86_64.pkg.tar.zst
|
|
|
|
publish:
|
|
name: Publish release
|
|
needs: [make_bin, make_arch]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Get version
|
|
id: get_version
|
|
run: |
|
|
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
|
|
echo ::set-output name=FULL_TAG::${GITHUB_REF/refs\/tags\//}
|
|
|
|
- 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: Download Linux binary
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: tmux-helper-linux
|
|
path: ./
|
|
|
|
- name: Download macOS binary
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: tmux-helper-macos
|
|
path: ./
|
|
|
|
- name: Download Arch package
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: arch_linux_tmux-helper-x86_64.pkg.tar.zst
|
|
path: ./
|
|
|
|
- name: Upload binary assets
|
|
run: |
|
|
wget https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2
|
|
tar xjf linux-amd64-github-release.tar.bz2
|
|
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
|
|
|
|
./bin/linux/amd64/github-release upload -u house-of-vanity -r tmux-helper --tag ${{ steps.get_version.outputs.FULL_TAG }} --name arch_linux_tmux-helper-${{ steps.get_version.outputs.VERSION }}-x86_64.pkg.tar.zst --file ./tmux-helper-x86_64.pkg.tar.zst
|
|
|
|
./bin/linux/amd64/github-release
|
|
|