chore(release) fix pipeline

This commit is contained in:
Kasper Juul Hermansen 2022-12-18 22:21:07 +01:00
parent 560f8f4fd0
commit 5894bd5bb1
Signed by: kjuulh
GPG Key ID: 0F95C140730F2F23
3 changed files with 84 additions and 81 deletions

82
.github/workflows/release-published.yml vendored Normal file
View File

@ -0,0 +1,82 @@
name: release-published
on:
release:
types: [published]
jobs:
brew-releaser:
name: Homebrew releaser
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Release to homebrew tap
uses: Justintime50/homebrew-releaser@v1
if: ${{ github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, 'chore(release)') }}
with:
# The name of the homebrew tap to publish your formula to as it appears on GitHub.
# Required - strings.
homebrew_owner: kjuulh
homebrew_tap: brew
# The name of the folder in your homebrew tap where formula will be committed to.
# Default is shown - string.
formula_folder: formula
# The GitHub Token (saved as a repo secret) that has `repo` permissions for the homebrew tap you want to release to.
# Required - string.
github_token: ${{ secrets.BREW_GITHUB_TOKEN }}
# Git author info used to commit to the homebrew tap.
# Defaults are shown - strings.
commit_owner: kjuulh
commit_email: homebrew-releaser@kjuulh.io
# Custom dependencies in case other formulas are needed to build the current one.
# Optional - multiline string.
#depends_on: |
# Custom install command for your formula.
# Required - string.
install: 'bin.install "toolkit"'
# Custom test command for your formula so you can run `brew test`.
# Optional - string.
#test: 'assert_match("my script output", shell_output("my-script-command"))'
# Adds URL and checksum targets for different OS and architecture pairs. Using this option assumes
# a tar archive exists on your GitHub repo with the following URL pattern (this cannot be customized):
# https://github.com/{GITHUB_OWNER}/{REPO_NAME}/releases/download/{TAG}/{REPO_NAME}-{VERSION}-{OPERATING_SYSTEM}-{ARCHITECTURE}.tar.gz'
# Darwin AMD pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-darwin-amd64.tar.gz
# Linux ARM pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-linux-arm64.tar.gz
# Optional - booleans.
target_darwin_amd64: true
target_darwin_arm64: true
target_linux_amd64: true
target_linux_arm64: true
# Update your homebrew tap's README with a table of all projects in the tap.
# This is done by pulling the information from all your formula.rb files - eg:
#
# | Project | Description | Install |
# | ------------------------------------------ | ------------ | ------------------------ |
# | [formula_1](https://github.com/user/repo1) | helpful text | `brew install formula_1` |
# | [formula_2](https://github.com/user/repo2) | helpful text | `brew install formula_2` |
# | [formula_3](https://github.com/user/repo3) | helpful text | `brew install formula_3` |
#
# Simply place the following in your README or wrap your project in these comment tags:
# <!-- project_table_start -->
# TABLE HERE
# <!--project_table_end -->
#
# Finally, mark `update_readme_table` as `true` in your GitHub Action config and we'll do the work of building a custom table for you.
# Default is `false` - boolean.
update_readme_table: true
# Skips committing the generated formula to a homebrew tap (useful for local testing).
# Default is shown - boolean.
skip_commit: false
# Logs debugging info to console.
# Default is shown - boolean.
debug: true

View File

@ -112,80 +112,3 @@ jobs:
*.zip
name: ${{ steps.get_version.outputs.value }}
tag_name: ${{ steps.get_version.outputs.value }}
brew-releaser:
name: Homebrew releaser
needs: [release]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Release to homebrew tap
uses: Justintime50/homebrew-releaser@v1
if: ${{ github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, 'chore(release)') }}
with:
# The name of the homebrew tap to publish your formula to as it appears on GitHub.
# Required - strings.
homebrew_owner: kjuulh
homebrew_tap: brew
# The name of the folder in your homebrew tap where formula will be committed to.
# Default is shown - string.
formula_folder: formula
# The GitHub Token (saved as a repo secret) that has `repo` permissions for the homebrew tap you want to release to.
# Required - string.
github_token: ${{ secrets.BREW_GITHUB_TOKEN }}
# Git author info used to commit to the homebrew tap.
# Defaults are shown - strings.
commit_owner: kjuulh
commit_email: homebrew-releaser@kjuulh.io
# Custom dependencies in case other formulas are needed to build the current one.
# Optional - multiline string.
#depends_on: |
# Custom install command for your formula.
# Required - string.
install: 'bin.install "toolkit"'
# Custom test command for your formula so you can run `brew test`.
# Optional - string.
#test: 'assert_match("my script output", shell_output("my-script-command"))'
# Adds URL and checksum targets for different OS and architecture pairs. Using this option assumes
# a tar archive exists on your GitHub repo with the following URL pattern (this cannot be customized):
# https://github.com/{GITHUB_OWNER}/{REPO_NAME}/releases/download/{TAG}/{REPO_NAME}-{VERSION}-{OPERATING_SYSTEM}-{ARCHITECTURE}.tar.gz'
# Darwin AMD pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-darwin-amd64.tar.gz
# Linux ARM pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-linux-arm64.tar.gz
# Optional - booleans.
target_darwin_amd64: true
target_darwin_arm64: true
target_linux_amd64: true
target_linux_arm64: true
# Update your homebrew tap's README with a table of all projects in the tap.
# This is done by pulling the information from all your formula.rb files - eg:
#
# | Project | Description | Install |
# | ------------------------------------------ | ------------ | ------------------------ |
# | [formula_1](https://github.com/user/repo1) | helpful text | `brew install formula_1` |
# | [formula_2](https://github.com/user/repo2) | helpful text | `brew install formula_2` |
# | [formula_3](https://github.com/user/repo3) | helpful text | `brew install formula_3` |
#
# Simply place the following in your README or wrap your project in these comment tags:
# <!-- project_table_start -->
# TABLE HERE
# <!--project_table_end -->
#
# Finally, mark `update_readme_table` as `true` in your GitHub Action config and we'll do the work of building a custom table for you.
# Default is `false` - boolean.
update_readme_table: true
# Skips committing the generated formula to a homebrew tap (useful for local testing).
# Default is shown - boolean.
skip_commit: false
# Logs debugging info to console.
# Default is shown - boolean.
debug: true

View File

@ -1,5 +1,3 @@
use std::{borrow::Borrow, ffi::OsString};
pub struct Search;
impl util::Cmd for Search {
@ -12,8 +10,8 @@ impl util::Cmd for Search {
fn exec(args: &clap::ArgMatches) -> eyre::Result<()> {
match args.subcommand() {
Some((external, args)) => {
let mut raw = args
.get_many::<OsString>("")
let raw = args
.get_many::<std::ffi::OsString>("")
.ok_or(eyre::anyhow!("please pass some args to search"))?
.map(|s| s.as_os_str())
.map(|s| s.to_string_lossy().to_string())