@@ -37,42 +37,72 @@ jobs:
3737 return releases.data[0].tag_name;
3838
3939 - name : Set tag name ( Workflow Run )
40+ id : tag_run
4041 if : github.event_name == 'workflow_run'
41- run : echo "tag_name=${{ steps.latest_tag.outputs.result }}" >> $GITHUB_ENV
42+ run : echo "tag_name=${{ steps.latest_tag.outputs.result }}" >> $GITHUB_OUTPUT
4243
4344 - name : Set tag name ( Workflow Dispatch )
45+ id : tag_dispatch
4446 if : github.event_name == 'workflow_dispatch'
45- run : echo "tag_name=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
47+ run : echo "tag_name=${{ github.event.inputs.tag_name }}" >> $GITHUB_OUTPUT
48+
49+ - name : Set final tag name
50+ id : final_tag
51+ run : |
52+ if [ "${{ github.event_name }}" == "workflow_run" ]; then
53+ echo "tag_name=${{ steps.tag_run.outputs.tag_name }}" >> $GITHUB_OUTPUT
54+ else
55+ echo "tag_name=${{ steps.tag_dispatch.outputs.tag_name }}" >> $GITHUB_OUTPUT
56+ fi
57+
58+ - name : Debug environment variables
59+ run : |
60+ echo "Tag name: ${{ steps.final_tag.outputs.tag_name }}"
61+ echo "Event name: ${{ github.event_name }}"
4662
4763 - name : Download binary
4864 run : |
49- curl -LO "https://github.com/${{ github.repository }}/releases/download/${{ env .tag_name }}/macutil"
65+ curl -LO "https://github.com/${{ github.repository }}/releases/download/${{ steps.final_tag.outputs .tag_name }}/macutil"
5066
5167 - name : Set env
68+ id : branch_setup
5269 run : |
5370 chmod +x macutil
5471 mkdir -p build
5572 mv macutil build/macutil
5673 echo "${{ github.workspace }}/build" >> $GITHUB_PATH
57- echo "branch_name=${{ env.tag_name }}" | tr . - >> $GITHUB_ENV
74+ branch_name=$(echo "${{ steps.final_tag.outputs.tag_name }}" | tr . -)
75+ echo "branch_name=$branch_name" >> $GITHUB_OUTPUT
5876
59- - name : Generate preview
60- uses :
charmbracelet/[email protected] 61- with :
62- path : " .github/preview.tape"
77+ - name : Install dependencies manually
78+ run : |
79+ sudo apt-get update
80+ sudo apt-get install -y ffmpeg
81+
82+ - name : Install VHS directly
83+ run : |
84+ # Download and install VHS from releases
85+ curl -LO "https://github.com/charmbracelet/vhs/releases/latest/download/vhs_Linux_x86_64.tar.gz"
86+ tar -xzf vhs_Linux_x86_64.tar.gz
87+ sudo mv vhs /usr/local/bin/vhs
88+ chmod +x /usr/local/bin/vhs
89+
90+ - name : Generate preview with VHS
91+ run : |
92+ vhs .github/preview.tape
6393
6494 - name : Move preview
6595 run : mv preview.gif .github/preview.gif
6696
6797 - name : Create PR
6898 uses :
peter-evans/[email protected] 6999 with :
70- commit-message : Preview for ${{ env .tag_name }}
71- branch : preview-${{ env .branch_name }}
72- title : " Update preview for ${{ env .tag_name }}"
100+ commit-message : Preview for ${{ steps.final_tag.outputs .tag_name }}
101+ branch : preview-${{ steps.branch_setup.outputs .branch_name }}
102+ title : " Update preview for ${{ steps.final_tag.outputs .tag_name }}"
73103 labels : |
74104 documentation
75105 body : |
76- Automated PR to update preview gif for version ${{ env .tag_name }}
77- 
106+ Automated PR to update preview gif for version ${{ steps.final_tag.outputs .tag_name }}
107+ 
78108 if : success()
0 commit comments