Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
qianlifeng committed Aug 7, 2024
1 parent 66f7c13 commit c9fd2eb
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/update_cask.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Update Wox Cask

on:
workflow_dispatch: # only dispatch manually

jobs:
update_cask:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Update cask
run: |
LATEST_AMD64_FILENAME=$(curl --silent "https://api.github.com/repos/wox-launcher/wox/releases/latest" | grep 'mac-amd64' | sed -n 's/.*"name": "\(.*\)".*/\1/p')
LATEST_AMD64_RELEASE=$(curl --silent "https://api.github.com/repos/wox-launcher/wox/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
LATEST_AMD64_SHA=$(curl -sL "https://github.com/localsend/wox-launcher/releases/download/v${LATEST_RELEASE}/${LATEST_AMD64_FILENAME}" | sha256sum | cut -f 1 -d " ")
echo "Latest amd64 release: $LATEST_AMD64_RELEASE"
echo "Latest amd64 SHA: $LATEST_AMD64_SHA"
LATEST_ARM64_FILENAME=$(curl --silent "https://api.github.com/repos/wox-launcher/wox/releases/latest" | grep 'mac-amd64' | sed -n 's/.*"name": "\(.*\)".*/\1/p')
LATEST_ARM64_RELEASE=$(curl --silent "https://api.github.com/repos/wox-launcher/wox/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
LATEST_ARM64_SHA=$(curl -sL "https://github.com/localsend/wox-launcher/releases/download/v${LATEST_RELEASE}/${LATEST_ARM64_FILENAME}" | sha256sum | cut -f 1 -d " ")
echo "Latest arm64 release: $LATEST_ARM64_RELEASE"
echo "Latest arm64 SHA: $LATEST_ARM64_SHA"
echo "LATEST_AMD64_RELEASE=$LATEST_AMD64_RELEASE" >> $GITHUB_ENV
- name: Commit and push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
COMMIT_MSG="Update Wox cask to v${{ env.LATEST_AMD64_RELEASE }}"
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add Casks/wox.rb
git commit -m "$COMMIT_MSG"
git push
23 changes: 23 additions & 0 deletions Casks/wox.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
cask "wox" do
arch arm: "arm64", intel: "x86_64"

on_arm do
version "v2.0.0-nightly"
sha256 "aae104dc1267ad6da27c6deb506c6048b03848a95a7c42ad953297516c8e419d"
filename "wox-mac-arm64-20240807-5c43a4.dmg"
end
on_intel do
version "v2.0.0-nightly"
sha256 "d57314b3c9243fa9e5df1a6a169e464ec3b4c5bca536a0edcae5d57a3ed53bd1"
filename "wox-mac-amd64-20240807-a78e72.dmg"
end

url "https://github.com/Wox-launcher/Wox/releases/download/#{version}/#{filename}"
name "Wox"
desc "A cross-platform launcher that simply works"
homepage "https://github.com/Wox-launcher/Wox"

depends_on macos: ">= :big_sur"

app "Wox.app"
end

0 comments on commit c9fd2eb

Please sign in to comment.