Skip to content

Commit

Permalink
Improve the matrix of releases
Browse files Browse the repository at this point in the history
  • Loading branch information
fcsonline committed Jan 31, 2022
1 parent db2663d commit bbf677f
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 36 deletions.
53 changes: 22 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
name: release

on:
push:
tags:
- '*'

workflow_dispatch:
release:
types: [published]

jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: build
uses: sassman/[email protected]
with:
target: x86_64-unknown-linux-musl
- name: package
run: |
cd "$GITHUB_WORKSPACE"
mkdir -p package
mkdir -p package/target/release
cp -v tmux-thumbs.sh tmux-thumbs.tmux package/
cp -v target/x86_64-unknown-linux-musl/release/thumbs package/target/release
cp -v target/x86_64-unknown-linux-musl/release/tmux-thumbs package/target/release
tar czvf tmux-thumbs.x86_64-musl.tar.gz package/*
- name: create_release
uses: ncipollo/[email protected]
with:
artifactErrorsFailBuild: true
artifacts: "tmux-thumbs.x86_64-musl.tar.gz"
release:
name: release ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-musl
archive: tar.gz tar.xz
- target: x86_64-apple-darwin
archive: zip
steps:
- uses: actions/checkout@master
- name: Compile and release
uses: rust-build/rust-build.action@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUSTTARGET: ${{ matrix.target }}
EXTRA_FILES: "tmux-thumbs.sh tmux-thumbs.tmux tmux-thumbs-install.sh"
ARCHIVE_TYPES: ${{ matrix.archive }}
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thumbs"
version = "0.6.1"
version = "0.7.0"
authors = ["Ferran Basora <[email protected]>"]
edition = "2018"
description = "A lightning fast version copy/pasting like vimium/vimperator"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ cargo install thumbs
And those are all available options:

```
thumbs 0.6.0
thumbs 0.7.0
A lightning fast version copy/pasting like vimium/vimperator
USAGE:
Expand Down
11 changes: 9 additions & 2 deletions tmux-thumbs.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
#!/usr/bin/env bash
set -Eeu -o pipefail

# Setup env variables to be compatible with compiled and bundled installations
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

BINARY="${CURRENT_DIR}/target/release/thumbs"
if [ -d .git ]; then
RELEASE_DIR="${CURRENT_DIR}/target/release"
else
RELEASE_DIR=${CURRENT_DIR}
fi

BINARY="${RELEASE_DIR}/thumbs"

if [ ! -f "$BINARY" ]; then
tmux split-window "cd ${CURRENT_DIR} && bash ./tmux-thumbs-install.sh"
Expand Down Expand Up @@ -43,4 +50,4 @@ add-param upcase-command string
add-param multi-command string
add-param osc52 boolean

"${CURRENT_DIR}/target/release/tmux-thumbs" "${PARAMS[@]}" || true
"${RELEASE_DIR}/tmux-thumbs" "${PARAMS[@]}" || true

0 comments on commit bbf677f

Please sign in to comment.