2021-04-30 18:22:33 +02:00
|
|
|
name: CLI Release
|
2021-04-10 13:53:12 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
2021-04-30 18:22:33 +02:00
|
|
|
- "cli-v*.*.*"
|
2021-04-10 13:53:12 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
name:
|
|
|
|
- linux-amd64-gnu
|
|
|
|
- linux-amd64-musl
|
|
|
|
- linux-i686-musl
|
|
|
|
- linux-armhf-gnu
|
|
|
|
- linux-arm64-gnu
|
|
|
|
- mac-x86-64
|
2021-04-21 00:00:15 +02:00
|
|
|
- mac-arm64
|
2021-04-10 13:53:12 +02:00
|
|
|
- windows-x86-64
|
|
|
|
include:
|
|
|
|
- name: linux-amd64-gnu
|
|
|
|
os: ubuntu-latest
|
|
|
|
target: x86_64-unknown-linux-gnu
|
|
|
|
cross: false
|
2021-04-21 00:00:15 +02:00
|
|
|
experimental: false
|
2021-04-10 13:53:12 +02:00
|
|
|
|
|
|
|
- name: linux-amd64-musl
|
|
|
|
os: ubuntu-latest
|
|
|
|
target: x86_64-unknown-linux-musl
|
|
|
|
cross: true
|
2021-04-21 00:00:15 +02:00
|
|
|
experimental: false
|
2021-04-10 13:53:12 +02:00
|
|
|
|
|
|
|
- name: linux-i686-musl
|
|
|
|
os: ubuntu-latest
|
|
|
|
target: i686-unknown-linux-musl
|
|
|
|
cross: true
|
2021-04-21 00:00:15 +02:00
|
|
|
experimental: true
|
2021-04-10 13:53:12 +02:00
|
|
|
|
|
|
|
- name: linux-armhf-gnu
|
|
|
|
os: ubuntu-latest
|
|
|
|
target: armv7-unknown-linux-gnueabihf
|
|
|
|
cross: true
|
2021-04-21 00:00:15 +02:00
|
|
|
experimental: false
|
2021-04-10 13:53:12 +02:00
|
|
|
|
|
|
|
- name: linux-arm64-gnu
|
|
|
|
os: ubuntu-latest
|
|
|
|
target: aarch64-unknown-linux-gnu
|
|
|
|
cross: true
|
2021-04-21 00:00:15 +02:00
|
|
|
experimental: false
|
2021-04-10 13:53:12 +02:00
|
|
|
|
|
|
|
- name: mac-x86-64
|
|
|
|
os: macos-latest
|
|
|
|
target: x86_64-apple-darwin
|
|
|
|
cross: false
|
2021-04-21 00:00:15 +02:00
|
|
|
experimental: false
|
|
|
|
|
|
|
|
- name: mac-arm64
|
2021-04-30 16:25:10 +02:00
|
|
|
os: macos-11.0
|
2021-04-21 00:00:15 +02:00
|
|
|
target: aarch64-apple-darwin
|
|
|
|
cross: true
|
|
|
|
experimental: true
|
2021-04-10 13:53:12 +02:00
|
|
|
|
|
|
|
- name: windows-x86-64
|
|
|
|
os: windows-latest
|
|
|
|
target: x86_64-pc-windows-msvc
|
|
|
|
cross: false
|
2021-04-21 00:00:15 +02:00
|
|
|
experimental: false
|
2021-04-10 13:53:12 +02:00
|
|
|
|
2021-04-30 16:26:33 +02:00
|
|
|
- name: windows-arm64
|
|
|
|
os: windows-latest
|
|
|
|
target: aarch64-pc-windows-msvc
|
|
|
|
cross: true
|
|
|
|
experimental: true
|
|
|
|
|
2021-04-10 13:53:12 +02:00
|
|
|
name: Binaries for ${{ matrix.name }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
2021-04-21 00:00:15 +02:00
|
|
|
continue-on-error: ${{ matrix.experimental }}
|
2021-04-10 13:53:12 +02:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/registry
|
|
|
|
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-04-30 16:25:10 +02:00
|
|
|
target: ${{ matrix.target }}
|
2021-04-10 13:53:12 +02:00
|
|
|
toolchain: stable
|
|
|
|
profile: minimal
|
|
|
|
override: true
|
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
name: Build
|
|
|
|
with:
|
|
|
|
use-cross: ${{ matrix.cross }}
|
|
|
|
command: build
|
2021-05-08 15:23:06 +02:00
|
|
|
args: --package watchexec-cli --release --locked --target ${{ matrix.target }}
|
2021-04-10 13:53:12 +02:00
|
|
|
- name: Package
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -euxo pipefail
|
|
|
|
ext=""
|
|
|
|
[[ "${{ matrix.name }}" == windows-* ]] && ext=".exe"
|
|
|
|
bin="target/${{ matrix.target }}/release/watchexec${ext}"
|
2021-05-08 16:19:38 +02:00
|
|
|
version=$(grep -oE '[0-9.]+' <<< "${{ github.ref }}")
|
2021-04-10 13:53:12 +02:00
|
|
|
dst="watchexec-${version}-${{ matrix.target }}"
|
|
|
|
mkdir "$dst"
|
|
|
|
strip "$bin" || true
|
|
|
|
mv "$bin" "$dst/"
|
2021-05-08 17:39:13 +02:00
|
|
|
mv cli/README.md LICENSE completions doc/watchexec.1{,.html} "$dst/"
|
2021-04-10 13:53:12 +02:00
|
|
|
- name: Archive (tar)
|
|
|
|
if: '! startsWith(matrix.name, ''windows-'')'
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -euxo pipefail
|
2021-05-08 16:19:38 +02:00
|
|
|
version=$(grep -oE '[0-9.]+' <<< "${{ github.ref }}")
|
2021-04-10 13:53:12 +02:00
|
|
|
dst="watchexec-${version}-${{ matrix.target }}"
|
|
|
|
tar cavf "$dst.tar.xz" "$dst"
|
|
|
|
- name: Archive (deb)
|
|
|
|
if: startsWith(matrix.name, 'linux-')
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -euxo pipefail
|
2021-05-08 16:19:38 +02:00
|
|
|
version=$(grep -oE '[0-9.]+' <<< "${{ github.ref }}")
|
2021-04-10 13:53:12 +02:00
|
|
|
dst="watchexec-${version}-${{ matrix.target }}"
|
|
|
|
mkdir -p "deb/$dst"
|
|
|
|
cd "deb/$dst"
|
2021-04-16 16:04:43 +02:00
|
|
|
mkdir -p DEBIAN usr/{bin,share/{man/man1,doc/watchexec,zsh/site-functions}}
|
2021-04-10 13:53:12 +02:00
|
|
|
cp "../../$dst/watchexec" usr/bin/
|
|
|
|
cp "../../$dst/watchexec.1" usr/share/man/man1/
|
2021-04-16 16:04:43 +02:00
|
|
|
cp "../../$dst/watchexec.1.html" usr/share/doc/watchexec/
|
2021-04-10 13:53:12 +02:00
|
|
|
cp "../../$dst/completions/zsh" usr/share/zsh/site-functions/_watchexec
|
|
|
|
cat <<-CONTROL > DEBIAN/control
|
|
|
|
Package: watchexec
|
|
|
|
Version: ${version}
|
|
|
|
Architecture: $(echo "${{ matrix.name }}" | cut -d- -f2)
|
|
|
|
Maintainer: Félix Saparelli <aur@passcod.name>
|
|
|
|
Installed-Size: $(du -d1 usr | tail -n1 | cut -d\t -f1)
|
|
|
|
Homepage: https://github.com/watchexec/watchexec
|
|
|
|
Description: Executes commands in response to file modifications.
|
|
|
|
Software development often involves running the same commands over and over. Boring!
|
|
|
|
Watchexec is a simple, standalone tool that watches a path and runs a command whenever it detects modifications.
|
|
|
|
CONTROL
|
|
|
|
cd ..
|
|
|
|
fakeroot dpkg -b "$dst"
|
|
|
|
mv "$dst.deb" ../
|
|
|
|
cd ..
|
|
|
|
- name: Archive (zip)
|
|
|
|
if: startsWith(matrix.name, 'windows-')
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -euxo pipefail
|
2021-05-08 16:19:38 +02:00
|
|
|
version=$(grep -oE '[0-9.]+' <<< "${{ github.ref }}")
|
2021-04-10 13:53:12 +02:00
|
|
|
dst="watchexec-${version}-${{ matrix.target }}"
|
|
|
|
7z a "$dst.zip" "$dst"
|
|
|
|
- uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
files: |
|
|
|
|
watchexec-*.tar.xz
|
|
|
|
watchexec-*.deb
|
|
|
|
watchexec-*.zip
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|