forked from ChrisTitusTech/linutil
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into skip-confirmation
- Loading branch information
Showing
35 changed files
with
480 additions
and
280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,8 @@ name: LinUtil Preview | |
on: | ||
workflow_dispatch: | ||
inputs: | ||
run_id: | ||
description: 'Run ID of LinUtil Release' | ||
tag_name: | ||
description: 'Tag name' | ||
required: true | ||
workflow_run: | ||
workflows: ["LinUtil Release"] | ||
|
@@ -14,29 +14,47 @@ on: | |
jobs: | ||
generate_preview: | ||
runs-on: ubuntu-latest | ||
environment: linutil_env | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Checkout source | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set Run ID | ||
run: | | ||
if [ "${{ github.event_name }}" == "workflow_run" ]; then | ||
echo "run_id=${{ github.event.workflow_run.id }}" >> $GITHUB_ENV | ||
else | ||
echo "run_id=${{ github.event.inputs.run_id }}" >> $GITHUB_ENV | ||
fi | ||
- name: Download build artifacts | ||
uses: actions/download-artifact@v4 | ||
- name: Get tag name ( Workflow Run ) | ||
id: latest_tag | ||
uses: actions/github-script@v7 | ||
if: github.event_name == 'workflow_run' | ||
with: | ||
name: linutil-artifact | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
run-id: ${{ env.run_id }} | ||
script: | | ||
const releases = await github.rest.repos.listReleases({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
per_page: 1 | ||
}); | ||
core.setOutput('result', releases.data[0].tag_name); | ||
result-encoding: string | ||
|
||
- name: Set tag name ( Workflow Run ) | ||
if: github.event_name == 'workflow_run' | ||
run: echo "tag_name=${{ steps.latest_tag.outputs.result }}" >> $GITHUB_ENV | ||
|
||
- name: Set tag name ( Workflow Dispatch ) | ||
if: ${{ github.event_name }} == 'workflow_dispatch' | ||
run: echo "tag_name=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV | ||
|
||
- name: Download binary | ||
run: | | ||
curl -LO "https://github.com/${{ github.repository }}/releases/download/${{ env.tag_name }}/linutil" | ||
- name: Set env | ||
run: | | ||
chmod +x linutil | ||
echo "${{ github.workspace }}" >> $GITHUB_PATH | ||
mkdir -p build | ||
mv linutil build/linutil | ||
echo "${{ github.workspace }}/build" >> $GITHUB_PATH | ||
- name: Generate preview | ||
uses: charmbracelet/[email protected] | ||
|
@@ -46,10 +64,15 @@ jobs: | |
- name: Move preview | ||
run: mv preview.gif docs/assets/preview.gif | ||
|
||
- name: Upload preview | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
- name: Create PR | ||
uses: peter-evans/[email protected] | ||
with: | ||
commit_message: Preview for ${{ env.run_id }} | ||
file_pattern: "docs/assets/preview.gif" | ||
add_options: "--force" | ||
commit-message: Preview for ${{ env.tag_name }} | ||
file-pattern: "docs/assets/preview.gif" | ||
add-options: "--force" | ||
token: ${{ secrets.PAT_TOKEN }} | ||
branch: feature/preview-${{ env.tag_name }} | ||
title: "Update preview for ${{ env.tag_name }}" | ||
body: | | ||
Automated PR to update preview gif for version ${{ env.tag_name }} | ||
if: success() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
external-sources=true | ||
source=core/tabs/common-script.sh |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.