Skip to content

Commit

Permalink
action to update homebrew tap
Browse files Browse the repository at this point in the history
  • Loading branch information
tuna-f1sh committed Dec 2, 2022
1 parent eb7d657 commit 4d9be2c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 6 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ jobs:
fi
# Let subsequent steps know where to find the (stripped) bin
echo "BIN_PATH=${BIN_PATH}" >> $GITHUB_OUTPUT
echo "BIN_NAME=${BIN_NAME}" >> $GITHUB_OUTPUT
echo "BIN_PATH=${BIN_PATH}" >> "$GITHUB_OUTPUT"
echo "BIN_NAME=${BIN_NAME}" >> "$GITHUB_OUTPUT"
- name: Extract crate information
shell: bash
run: |
echo "PROJECT_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> "$GITHUB_ENV"
echo "PROJECT_MAINTAINER=$(sed -n 's/^authors = \["\(.*\)"\]/\1/p' Cargo.toml)" >> "$GITHUB_ENV"
echo "PROJECT_HOMEPAGE=$(sed -n 's/^homepage = "\(.*\)"/\1/p' Cargo.toml)" >> $GITHUB_ENV
echo "PROJECT_HOMEPAGE=$(sed -n 's/^homepage = "\(.*\)"/\1/p' Cargo.toml)" >> "$GITHUB_ENV"
- name: Create tarball
id: package
Expand All @@ -100,7 +100,7 @@ jobs:
PKG_BASENAME=${PROJECT_NAME}-v${PROJECT_VERSION}-${{ matrix.job.target }}
PKG_NAME=${PKG_BASENAME}${PKG_suffix}
echo "PKG_NAME=${PKG_NAME}" >> $GITHUB_OUTPUT
echo "PKG_NAME=${PKG_NAME}" >> "$GITHUB_OUTPUT"
PKG_STAGING="${{ env.INTERMEDIATES_DIR }}/package"
ARCHIVE_DIR="${PKG_STAGING}/${PKG_BASENAME}/"
Expand All @@ -127,7 +127,7 @@ jobs:
esac;
popd >/dev/null
# Let subsequent steps know where to find the compressed package
echo "PKG_PATH=${PKG_STAGING}/${PKG_NAME}" >> $GITHUB_OUTPUT
echo "PKG_PATH=${PKG_STAGING}/${PKG_NAME}" >> "$GITHUB_OUTPUT"
- name: Upload package artifact
uses: actions/upload-artifact@master
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/homebrew_tap_update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy release to homebrew

on:
release:
types: [published]

jobs:
deploy-to-homebrew:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Get latest tag version
id: latest_tag
uses: "WyriHaximus/github-action-get-previous-tag@v1"

- name: Get sha-256 of macOS version
id: shasum_mac_os
run: |
wget https://github.com/tuna-f1sh/cyme/releases/download/${{ steps.latest_tag.outputs.tag }}/cyme-v${{ steps.latest_tag.outputs.tag }}-x86_64-apple-darwin.tar.gz
echo "sha=$(shasum -a 256 ./cyme-v${{ steps.latest_tag.outputs.tag }}-x86_64-apple-darwin.tar.gz | awk '{printf $1}')" >> "$GITHUB_OUTPUT"
- name: Update cyme homebrew formula
uses: naijabx/[email protected]
with:
repo: tuna-f1sh/cyme
tap: tuna-f1sh/homebrew-cyme
formula: cyme.rb
download-url: https://github.com/tuna-f1sh/cyme/releases/download/${{ steps.latest_tag.outputs.tag }}/cyme-v${{ steps.latest_tag.outputs.tag }}-x86_64-apple-darwin.tar.gz
sha256: ${{ steps.shasum_mac_os.outputs.sha }}
env:
COMMIT_TOKEN: ${{ secrets.CYME_TAP_TOKEN }}

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "List system USB buses and devices; a modern and compatiable `lsus
repository = "https://github.com/tuna-f1sh/cyme"
readme = "README.md"
license = "GPL-3.0-or-later"
version = "0.8.4"
version = "0.8.5"
edition = "2021"
keywords = ["usb", "lsusb", "system_profiler", "macos", "libusb"]
categories = ["command-line-utilities"]
Expand Down

0 comments on commit 4d9be2c

Please sign in to comment.