2021-04-30 18:22:33 +02:00
|
|
|
name: CLI Release
|
2021-04-10 13:53:12 +02:00
|
|
|
|
|
|
|
on:
|
2021-06-27 13:54:15 +02:00
|
|
|
workflow_dispatch:
|
2021-04-10 13:53:12 +02:00
|
|
|
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') }}
|
2021-06-27 13:55:40 +02:00
|
|
|
|
2021-07-21 17:18:10 +02:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
if: startsWith(matrix.name, 'linux-')
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/bin
|
|
|
|
key: ${{ runner.os }}-cargo-bin-${{ hashFiles('.github/workflows/release.yml') }}
|
2021-06-27 13:55:40 +02:00
|
|
|
- name: Install cargo-deb
|
2021-07-21 16:14:03 +02:00
|
|
|
if: startsWith(matrix.name, 'linux-')
|
2021-07-30 20:18:47 +02:00
|
|
|
run: which cargo-deb || cargo install cargo-deb --version 1.30.0 --locked
|
2021-07-30 20:36:47 +02:00
|
|
|
# - name: Install cargo-generate-rpm
|
|
|
|
# if: startsWith(matrix.name, 'linux-')
|
|
|
|
# run: which cargo-generate-rpm || cargo install cargo-generate-rpm --version 0.4.0 --locked
|
2021-06-27 13:55:56 +02:00
|
|
|
|
2021-04-10 13:53:12 +02:00
|
|
|
- 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
|
2021-06-27 13:54:15 +02:00
|
|
|
|
2021-04-10 13:53:12 +02:00
|
|
|
- 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-06-27 13:54:15 +02:00
|
|
|
|
|
|
|
- name: Extract version
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -euxo pipefail
|
|
|
|
|
|
|
|
version=$(grep -m1 -F 'version =' cli/Cargo.toml | cut -d\" -f2)
|
|
|
|
|
|
|
|
if [[ -z "$version" ]]; then
|
|
|
|
echo "Error: no version :("
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "$version" > VERSION
|
|
|
|
|
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-07-21 16:14:03 +02:00
|
|
|
strip "$bin" || true
|
|
|
|
|
2021-06-27 13:54:15 +02:00
|
|
|
version=$(cat VERSION)
|
2021-04-10 13:53:12 +02:00
|
|
|
dst="watchexec-${version}-${{ matrix.target }}"
|
|
|
|
mkdir "$dst"
|
2021-07-21 16:14:03 +02:00
|
|
|
|
|
|
|
mkdir -p "target/release"
|
|
|
|
cp "$bin" "target/release/" # workaround for cargo-deb silliness with targets
|
|
|
|
|
2021-06-27 13:55:56 +02:00
|
|
|
cp "$bin" "$dst/"
|
2021-07-21 16:14:03 +02:00
|
|
|
cp -r cli/README.md LICENSE completions doc/{logo.svg,watchexec.1{,.html}} "$dst/"
|
2021-06-27 13:54:15 +02:00
|
|
|
|
2021-04-10 13:53:12 +02:00
|
|
|
- name: Archive (tar)
|
|
|
|
if: '! startsWith(matrix.name, ''windows-'')'
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -euxo pipefail
|
2021-06-27 13:54:15 +02:00
|
|
|
version=$(cat VERSION)
|
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-06-27 13:54:15 +02:00
|
|
|
version=$(cat VERSION)
|
2021-04-10 13:53:12 +02:00
|
|
|
dst="watchexec-${version}-${{ matrix.target }}"
|
2021-07-21 16:14:03 +02:00
|
|
|
cargo deb -p watchexec-cli --no-build --no-strip --target ${{ matrix.target }} --output "$dst.deb"
|
2021-07-30 20:36:47 +02:00
|
|
|
# - name: Archive (rpm)
|
|
|
|
# if: startsWith(matrix.name, 'linux-')
|
|
|
|
# shell: bash
|
|
|
|
# run: |
|
|
|
|
# set -euxo pipefail
|
|
|
|
# shopt -s globstar
|
|
|
|
# version=$(cat VERSION)
|
|
|
|
# dst="watchexec-${version}-${{ matrix.target }}"
|
|
|
|
# cargo generate-rpm -p cli --target "${{ matrix.target }}" --target-dir "target/${{ matrix.target }}"
|
|
|
|
# mv target/**/*.rpm "$dst.rpm"
|
2021-04-10 13:53:12 +02:00
|
|
|
- name: Archive (zip)
|
|
|
|
if: startsWith(matrix.name, 'windows-')
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -euxo pipefail
|
2021-06-27 13:54:15 +02:00
|
|
|
version=$(cat VERSION)
|
2021-04-10 13:53:12 +02:00
|
|
|
dst="watchexec-${version}-${{ matrix.target }}"
|
|
|
|
7z a "$dst.zip" "$dst"
|
2021-06-27 13:54:15 +02:00
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: builds
|
|
|
|
retention-days: 1
|
|
|
|
path: |
|
|
|
|
watchexec-*.tar.xz
|
|
|
|
watchexec-*.tar.zst
|
|
|
|
watchexec-*.deb
|
|
|
|
watchexec-*.rpm
|
|
|
|
watchexec-*.zip
|
|
|
|
|
|
|
|
sign:
|
|
|
|
needs: build
|
|
|
|
|
|
|
|
name: Checksum and sign
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/bin
|
|
|
|
key: sign-tools-${{ hashFiles('.github/workflows/release.yml') }}
|
|
|
|
|
|
|
|
- name: Install rsign2
|
|
|
|
run: cargo install rsign2 --version 0.5.7
|
|
|
|
- name: Install b3sum
|
|
|
|
run: cargo install b3sum --version 0.3.7
|
|
|
|
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: builds
|
|
|
|
|
|
|
|
- name: Checksums with BLAKE3
|
|
|
|
run: b3sum watchexec-* | tee B3SUMS
|
|
|
|
|
|
|
|
- name: Checksums with SHA512
|
|
|
|
run: sha512sum watchexec-* | tee SHA512SUMS
|
|
|
|
|
|
|
|
- name: Sign checksums
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
RELEASE_KEY: ${{ secrets.RELEASE_KEY }}
|
|
|
|
run: |
|
|
|
|
set -u
|
|
|
|
echo "$RELEASE_KEY" > release.key
|
|
|
|
set -x
|
|
|
|
version=$(grep -m1 -F 'version =' cli/Cargo.toml | cut -d\" -f2)
|
|
|
|
for algo in B3 SHA512; do
|
|
|
|
echo | rsign sign \
|
|
|
|
-p .github/workflows/release.pub \
|
|
|
|
-s release.key \
|
|
|
|
-t "watchexec v$version signed with automated key" \
|
|
|
|
-c 'see website for signing information' \
|
|
|
|
-x "${algo}SUMS.auto.minisig" \
|
|
|
|
"${algo}SUMS"
|
|
|
|
done
|
|
|
|
rm release.key
|
|
|
|
cat {B3,SHA512}SUMS.auto.minisig
|
|
|
|
|
2021-04-10 13:53:12 +02:00
|
|
|
- uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
files: |
|
|
|
|
watchexec-*.tar.xz
|
2021-06-27 13:54:15 +02:00
|
|
|
watchexec-*.tar.zst
|
2021-04-10 13:53:12 +02:00
|
|
|
watchexec-*.deb
|
2021-06-27 13:54:15 +02:00
|
|
|
watchexec-*.rpm
|
2021-04-10 13:53:12 +02:00
|
|
|
watchexec-*.zip
|
2021-06-27 13:54:15 +02:00
|
|
|
*SUMS*
|
2021-04-10 13:53:12 +02:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|