mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 08:47:18 +02:00
215 lines
6.6 KiB
YAML
215 lines
6.6 KiB
YAML
name: CI
|
|
on: [push, pull_request]
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: macOS-latest
|
|
target: x86_64-apple-darwin
|
|
rust_flags: ''
|
|
features: ''
|
|
binary_postfix: ''
|
|
upx_args: --best
|
|
strip: true
|
|
- os: ubuntu-latest
|
|
target: x86_64-unknown-linux-gnu
|
|
rust_flags: ''
|
|
features: ''
|
|
binary_postfix: ''
|
|
upx_args: --best --lzma
|
|
strip: true
|
|
- os: ubuntu-latest
|
|
target: x86_64-unknown-linux-musl
|
|
rust_flags: ''
|
|
features: ''
|
|
binary: 'taskwarrior-tui-x86_64-unknown-linux-musl'
|
|
upx_args: --best --lzma
|
|
strip: true
|
|
- os: ubuntu-latest
|
|
target: i686-unknown-linux-musl
|
|
rust_flags: ''
|
|
features: ''
|
|
binary_postfix: ''
|
|
upx_args: --best --lzma
|
|
strip: true
|
|
- os: windows-latest
|
|
target: x86_64-pc-windows-gnu
|
|
rust_flags: -C target-feature=+crt-static
|
|
features: ''
|
|
binary_postfix: '.exe'
|
|
upx_args: -9
|
|
strip: false
|
|
- os: windows-latest
|
|
target: x86_64-pc-windows-msvc
|
|
rust_flags: -C target-feature=+crt-static
|
|
features: ''
|
|
binary_postfix: '.exe'
|
|
upx_args: -9
|
|
strip: false
|
|
- os: windows-latest
|
|
target: i686-pc-windows-msvc
|
|
rust_flags: -C target-feature=+crt-static
|
|
features: ''
|
|
binary_postfix: '.exe'
|
|
upx_args: -9
|
|
strip: false
|
|
env:
|
|
RUSTFLAGS: ${{ matrix.rust_flags }}
|
|
MACOSX_DEPLOYMENT_TARGET: 10.7
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
target: ${{ matrix.target }}
|
|
default: true
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --release ${{matrix.features}} --target=${{ matrix.target }}
|
|
- name: Compress binaries
|
|
uses: svenstaro/upx-action@v2
|
|
with:
|
|
file: target/${{ matrix.target }}/release/taskwarrior-tui${{ matrix.binary_postfix }}
|
|
args: ${{ matrix.upx_args }}
|
|
strip: ${{ matrix.strip }}
|
|
- name: Packaging binary
|
|
shell: bash
|
|
run: |
|
|
cd target/${{ matrix.target }}/release
|
|
tar czvf taskwarrior-tui-${{ matrix.target }}.tar.gz taskwarrior-tui${{ matrix.binary_postfix }}
|
|
if [[ ${{ runner.os }} == 'Windows' ]]; then
|
|
certutil -hashfile taskwarrior-tui-${{ matrix.target }}.tar.gz sha256 | grep -E [A-Fa-f0-9]{64} > taskwarrior-tui-${{ matrix.target }}.sha256
|
|
else
|
|
shasum -a 256 taskwarrior-tui-${{ matrix.target }}.tar.gz > taskwarrior-tui-${{ matrix.target }}.sha256
|
|
fi
|
|
- name: Releasing assets
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: |
|
|
target/${{ matrix.target }}/release/taskwarrior-tui-${{ matrix.target }}.tar.gz
|
|
target/${{ matrix.target }}/release/taskwarrior-tui-${{ matrix.target }}.sha256
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
publish:
|
|
name: Publishing to Cargo
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
override: true
|
|
|
|
homebrew:
|
|
name: Bump Homebrew formula
|
|
runs-on: macos-latest
|
|
steps:
|
|
- name: Update Homebrew formula
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: dawidd6/action-homebrew-bump-formula@v3
|
|
with:
|
|
token: ${{secrets.HOMEBREW_TOKEN}}
|
|
formula: taskwarrior-tui
|
|
|
|
debian:
|
|
name: Publish deb package
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v2
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --release
|
|
- name: Install cargo-deb
|
|
run: cargo install cargo-deb
|
|
- name: Build deb package
|
|
run: cargo deb -p taskwarrior-tui -o target/debian/taskwarrior-tui.deb
|
|
- name: Releasing assets
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: |
|
|
target/debian/*.deb
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
redhat:
|
|
name: Publish rpm package
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v2
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --release
|
|
- name: Install rpm
|
|
run: sudo apt-get install rpm
|
|
- name: Install cargo-rpm
|
|
run: cargo install cargo-rpm
|
|
- name: Build rpm package
|
|
run: cargo rpm build
|
|
|
|
arch:
|
|
name: Publish aur package
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v2
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --release
|
|
- name: Install cargo-aur
|
|
run: cargo install cargo-aur
|
|
- name: Build aur package
|
|
run: cargo aur
|
|
|
|
appimage:
|
|
name: Publish appimage package
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --release
|
|
- name: Build AppImage
|
|
run: |
|
|
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
|
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
|
|
chmod +x linuxdeploy-x86_64.AppImage
|
|
chmod +x appimagetool-x86_64.AppImage
|
|
mkdir -p AppDir/bin
|
|
cp target/release/taskwarrior-tui AppDir/bin/taskwarrior-tui
|
|
./linuxdeploy-x86_64.AppImage --appdir AppDir
|
|
./appimagetool-x86_64.AppImage AppDir/
|
|
|
|
snap:
|
|
name: Push to snap
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install Snapcraft
|
|
uses: samuelmeuli/action-snapcraft@v1
|
|
with:
|
|
use_lxd: true
|
|
snapcraft_token: ${{ secrets.SNAPCRAFT_TOKEN }}
|
|
|
|
- name: Install review tools
|
|
run: sudo snap install review-tools
|
|
|
|
- name: Build snap
|
|
run: sg lxd -c 'snapcraft --use-lxd'
|
|
|
|
- name: Publish snap
|
|
run: snapcraft upload ./taskwarrior-tui_*.snap
|