Skip to content

Commit

Permalink
fixed the releases and site and setuped npm and homebrew
Browse files Browse the repository at this point in the history
Signed-off-by: karan <[email protected]>
  • Loading branch information
KMJ-007 committed Sep 16, 2024
1 parent 64f6ccd commit fb8d8dd
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 10 deletions.
48 changes: 47 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,60 @@ jobs:
gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/*
publish-homebrew-formula:
needs:
- plan
- host
runs-on: "ubuntu-20.04"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLAN: ${{ needs.plan.outputs.val }}
GITHUB_USER: "axo bot"
GITHUB_EMAIL: "[email protected]"
if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
steps:
- uses: actions/checkout@v4
with:
repository: "kmj-007/homebrew-lazygh"
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
# So we have access to the formula
- name: Fetch homebrew formulae
uses: actions/download-artifact@v4
with:
pattern: artifacts-*
path: Formula/
merge-multiple: true
# This is extra complex because you can make your Formula name not match your app name
# so we need to find releases with a *.rb file, and publish with that filename.
- name: Commit formula files
run: |
git config --global user.name "${GITHUB_USER}"
git config --global user.email "${GITHUB_EMAIL}"
for release in $(echo "$PLAN" | jq --compact-output '.releases[] | select([.artifacts[] | endswith(".rb")] | any)'); do
filename=$(echo "$release" | jq '.artifacts[] | select(endswith(".rb"))' --raw-output)
name=$(echo "$filename" | sed "s/\.rb$//")
version=$(echo "$release" | jq .app_version --raw-output)
export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
brew update
# We avoid reformatting user-provided data such as the app description and homepage.
brew style --except-cops FormulaAudit/Homepage,FormulaAudit/Desc,FormulaAuditStrict --fix "Formula/${filename}" || true
git add "Formula/${filename}"
git commit -m "${name} ${version}"
done
git push
announce:
needs:
- plan
- host
- publish-homebrew-formula
# use "always() && ..." to allow us to wait for all publish jobs while
# still allowing individual publish jobs to skip themselves (for prereleases).
# "host" however must run to completion, no skipping allowed!
if: ${{ always() && needs.host.result == 'success' }}
if: ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') }}
runs-on: "ubuntu-20.04"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cargo-dist-version = "0.22.1"
# CI backends to support
ci = "github"
# The installers to generate for each app
installers = ["shell", "powershell", "npm", "msi"]
installers = ["shell", "powershell", "npm", "homebrew", "msi"]
# Target platforms to build apps for (Rust target-triple syntax)
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc"]
# The archive format to use for windows builds (defaults .zip)
Expand All @@ -49,3 +49,7 @@ unix-archive = ".tar.gz"
install-path = "CARGO_HOME"
# Whether to install an updater program
install-updater = true
# A GitHub repo to push Homebrew formulas to
tap = "kmj-007/homebrew-lazygh"
# Publish jobs to run in CI
publish-jobs = ["homebrew"]
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ If you encounter any problems or have suggestions for improvements, please open

## Roadmap

- [ ] Create a cross-platform installer(only homebrew tap is remaining)
- [ ] adding lazygh to binstall
- [ ] adding lazygh to nix-env
- [ ] adding lazygh to nix flake
- [ ] ability to maintain multiple gh config files and able to categorise them in workspace fashion but in simpler way
- [ ] don't know other things to add, create an issue if you have any ideas

## Security
Expand Down
14 changes: 8 additions & 6 deletions oranda.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
"favicon": "https://www.axo.dev/favicon.ico"
},
"marketing": {
"analytics": {
"google_analytics": {
"tracking_id": "G-TKS59X89PP"
}
},
"social": {
"image": "https://www.axo.dev/meta_small.jpeg",
"image_alt": "axo",
Expand All @@ -22,14 +27,11 @@
"artifacts": {
"package_managers": {
"preferred": {
"npm": "npm install @axodotdev/oranda --save-dev",
"cargo": "cargo install oranda --locked --profile=dist"
"npm": "npm install lazygh --global",
"cargo": "cargo install lazygh"
},
"additional": {
"npx": "npx @axodotdev/oranda",
"binstall": "cargo binstall oranda",
"nix-env": "nix-env -i oranda",
"nix flake": "nix profile install github:axodotdev/oranda"
"npx": "npx lazygh"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion wix/main.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
<!--<Icon Id='ProductICO' SourceFile='wix\Product.ico'/>-->
<!--<Property Id='ARPPRODUCTICON' Value='ProductICO' />-->

<Property Id='ARPHELPLINK' Value='https://github.com/kmj-007/lazygh'/>
<Property Id='ARPHELPLINK' Value='https://kmj-007.github.io/lazygh'/>

<UI>
<UIRef Id='WixUI_FeatureTree'/>
Expand Down

0 comments on commit fb8d8dd

Please sign in to comment.