From 6ae058891d7ea217963cf71650ccca0656bde0b1 Mon Sep 17 00:00:00 2001 From: Jeevitha Kannan K S Date: Wed, 9 Oct 2024 23:23:03 +0530 Subject: [PATCH 1/4] Seperate preview from linutil.yml --- .github/workflows/linutil.yml | 25 ++++------------ .github/workflows/preview.yml | 56 +++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/preview.yml diff --git a/.github/workflows/linutil.yml b/.github/workflows/linutil.yml index 53c43d02..446296b5 100644 --- a/.github/workflows/linutil.yml +++ b/.github/workflows/linutil.yml @@ -89,23 +89,10 @@ jobs: version: ${{ env.version }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Setup Preview - run: | - echo "$(pwd)/build" >> $GITHUB_PATH - - - name: Generate preview - uses: charmbracelet/vhs-action@v2.1.0 + - name: Upload build artifacts + uses: actions/upload-artifact@v4 with: - path: "docs/assets/preview.tape" - - - name: Move preview - run: | - mv preview.gif docs/assets/preview.gif - - - name: Upload preview - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: Preview for ${{ env.version }} - file_pattern: "docs/assets/preview.gif" - add_options: "--force" - if: success() \ No newline at end of file + name: linutil-artifact + path: build/linutil + compression-level: 0 + overwrite: true \ No newline at end of file diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 00000000..e7a75356 --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,56 @@ +name: LinUtil Preview + +on: + workflow_dispatch: + inputs: + run_id: + description: 'Run ID of LinUtil Release' + required: true + workflow_run: + workflows: ["LinUtil Release"] + types: + - completed + +jobs: + generate_preview: + runs-on: ubuntu-latest + + steps: + - 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 + with: + name: linutil-artifact + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ env.run_id }} + + - name: Set env + run: | + chmod +x linutil + echo "${{ github.workspace }}" >> $GITHUB_PATH + + - name: Generate preview + uses: charmbracelet/vhs-action@v2.1.0 + with: + path: "docs/assets/preview.tape" + + - name: Move preview + run: | + mv preview.gif docs/assets/preview.gif + + - name: Upload preview + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Preview for ${{ github.sha }} + file_pattern: "docs/assets/preview.gif" + add_options: "--force" + if: success() \ No newline at end of file From a804fbf81dda88194927b47b30855328294eacb1 Mon Sep 17 00:00:00 2001 From: Jeevitha Kannan K S Date: Wed, 9 Oct 2024 23:37:19 +0530 Subject: [PATCH 2/4] Fix paths as per https://github.com/ChrisTitusTech/linutil/pull/791 --- .github/workflows/linutil.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linutil.yml b/.github/workflows/linutil.yml index 446296b5..6b167aa6 100644 --- a/.github/workflows/linutil.yml +++ b/.github/workflows/linutil.yml @@ -93,6 +93,6 @@ jobs: uses: actions/upload-artifact@v4 with: name: linutil-artifact - path: build/linutil + path: build/x86_64-unknown-linux-musl/release/linutil compression-level: 0 overwrite: true \ No newline at end of file From bf80a9d7619fa78614583a18b99e203458b76766 Mon Sep 17 00:00:00 2001 From: Jeevitha Kannan K S Date: Wed, 9 Oct 2024 23:42:15 +0530 Subject: [PATCH 3/4] Refact commit msg --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index e7a75356..725f781a 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -50,7 +50,7 @@ jobs: - name: Upload preview uses: stefanzweifel/git-auto-commit-action@v5 with: - commit_message: Preview for ${{ github.sha }} + commit_message: Preview for ${{ env.run_id }} file_pattern: "docs/assets/preview.gif" add_options: "--force" if: success() \ No newline at end of file From 335fb8193de56138c69164b0b565800f1959cee9 Mon Sep 17 00:00:00 2001 From: JEEVITHA KANNAN K S Date: Thu, 10 Oct 2024 02:10:43 +0530 Subject: [PATCH 4/4] Update preview.yml --- .github/workflows/preview.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 725f781a..82bd17f1 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -44,8 +44,7 @@ jobs: path: "docs/assets/preview.tape" - name: Move preview - run: | - mv preview.gif docs/assets/preview.gif + run: mv preview.gif docs/assets/preview.gif - name: Upload preview uses: stefanzweifel/git-auto-commit-action@v5 @@ -53,4 +52,4 @@ jobs: commit_message: Preview for ${{ env.run_id }} file_pattern: "docs/assets/preview.gif" add_options: "--force" - if: success() \ No newline at end of file + if: success()