Bump version #19
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
build-and-upload: | |
name: Build and upload | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- build: linux | |
os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
- build: macos-x86_64 | |
os: macos-latest | |
target: x86_64-apple-darwin | |
- build: macos-aarch64 | |
os: macos-latest | |
target: aarch64-apple-darwin | |
- build: windows-msvc | |
os: windows-latest | |
target: x86_64-pc-windows-msvc | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get the release version from the tag | |
shell: bash | |
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Build UI dist | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.x' | |
- run: cd clip-sync-ui && npm install && npm run build | |
- name: Install Linux Dep | |
shell: bash | |
run: | | |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then | |
sudo apt-get -y update | |
sudo apt-get install -y libdbus-1-dev pkg-config libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev | |
fi | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
# Make Rust compile to our target (defined in the matrix) | |
targets: ${{ matrix.target }} | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
use-cross: false | |
command: build | |
args: --verbose --release --target ${{ matrix.target }} | |
- name: Build archive | |
shell: bash | |
run: | | |
# Replace with the name of your binary | |
package_name="clip-sync" | |
dirname="$package_name-${{ env.VERSION }}-${{ matrix.target }}" | |
mkdir "$dirname" | |
if [ "${{ matrix.os }}" = "windows-latest" ]; then | |
mv "target/${{ matrix.target }}/release/clip-sync.exe" "$dirname" | |
mv "target/${{ matrix.target }}/release/clip-sync-cli.exe" "$dirname" | |
mv "target/${{ matrix.target }}/release/clip-sync-server.exe" "$dirname" | |
cp -r clip-sync-ui/dist "$dirname" | |
else | |
mv "target/${{ matrix.target }}/release/clip-sync" "$dirname" | |
mv "target/${{ matrix.target }}/release/clip-sync-cli" "$dirname" | |
mv "target/${{ matrix.target }}/release/clip-sync-server" "$dirname" | |
cp -r clip-sync-ui/dist "$dirname" | |
fi | |
if [ "${{ matrix.os }}" = "windows-latest" ]; then | |
7z a "$dirname.zip" "$dirname" | |
echo "ASSET=$dirname.zip" >> $GITHUB_ENV | |
else | |
tar -czf "$dirname.tar.gz" "$dirname" | |
echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV | |
fi | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
${{ env.ASSET }} |