Skip to content

Commit

Permalink
Install selfup prebuilt binary in resueable workflow to make faster (#…
Browse files Browse the repository at this point in the history
…289)

* Install selfup prebuilt binary in resueable workflow to make faster

* Add missing env for using gh

* We can make the step earlier since specified repo with the cli

* Consider arch use

* Use fullpath to avoid x86_64 and X64 string difference, we specified ubuntu-24.04 avobe

* Update README
  • Loading branch information
kachick authored Oct 16, 2024
1 parent 4efecbd commit 70ec1c8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/reusable-bump-flake-lock-and-selfup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ jobs:
env:
PR_BRANCH: bot-update-flake-lock
steps:
- name: Install selfup
env:
GH_TOKEN: ${{ github.token }}
run: |
install_path="$(mktemp -d)"
cd "$install_path"
gh release download '${{ inputs.version }}' --pattern 'selfup_Linux_x86_64.tar.gz' --repo kachick/selfup
tar -xvzf 'selfup_Linux_x86_64.tar.gz'
echo "$install_path" | tee -a "$GITHUB_PATH"
- name: Make sure the installed selfup version
run: selfup --version
# To push workflow changes and trigger CIs
- name: Generate GitHub Apps token
id: publish-token
Expand Down Expand Up @@ -85,7 +96,7 @@ jobs:
run: nix flake update --commit-lock-file
- name: Update related CI dependencies
run: |
git ls-files .github | xargs nix develop --command nix run github:kachick/selfup/${{ inputs.version }} -- run
git ls-files .github | selfup run
git diff-index --quiet HEAD || git commit -m '${{ inputs.selfup-commit-message }}' .github
- name: Run optional step if given
if: inputs.optional-run != ''
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ Prebuilt binaries are available for download from [releases](https://github.com/
selfup VERSION (REV)
```

You can also use [gh](https://github.com/cli/cli) command.

```bash
gh release download 'v1.1.5' --pattern 'selfup_Linux_x86_64.tar.gz' --repo kachick/selfup
tar -xvzf 'selfup_Linux_x86_64.tar.gz'
```

## Usage

```plaintext
Expand Down

0 comments on commit 70ec1c8

Please sign in to comment.