5
5
branches :
6
6
- main
7
7
- master
8
- workflow_dispatch : # Allow manual triggering
8
+ workflow_dispatch :
9
9
10
10
jobs :
11
- build-rolling-release :
11
+ build :
12
12
runs-on : ubuntu-latest
13
13
permissions :
14
14
contents : write
15
-
16
15
strategy :
17
16
matrix :
18
17
target :
26
25
- name : Setup repo
27
26
uses : actions/checkout@v5
28
27
with :
29
- fetch-depth : 0 # Fetch full history for git commands
28
+ fetch-depth : 0
30
29
31
30
- name : Setup Deno
32
31
uses : denoland/setup-deno@v2
36
35
- name : Set binary name
37
36
id : binary-name
38
37
run : |
39
- echo "Building for target: ${{ matrix.target }}"
40
38
case "${{ matrix.target }}" in
41
39
*-windows-*)
42
40
echo "name=invidious_companion.exe" >> $GITHUB_OUTPUT
@@ -47,35 +45,13 @@ jobs:
47
45
echo "archive_name=invidious_companion-${{ matrix.target }}.tar.gz" >> $GITHUB_OUTPUT
48
46
;;
49
47
esac
50
- echo "Binary name: $(cat $GITHUB_OUTPUT | grep '^name=' | cut -d= -f2)"
51
- echo "Archive name: $(cat $GITHUB_OUTPUT | grep '^archive_name=' | cut -d= -f2)"
52
48
53
49
- name : Build binary
54
50
run : |
55
51
deno compile \
56
52
--target="${{ matrix.target }}" \
57
- --include ./src/lib/helpers/youtubePlayerReq.ts \
58
- --include ./src/lib/helpers/getFetchClient.ts \
59
53
--output "${{ steps.binary-name.outputs.name }}" \
60
- --allow-import=github.com:443,jsr.io:443,cdn.jsdelivr.net:443,esm.sh:443,deno.land:443 \
61
- --allow-net \
62
- --allow-env \
63
- --allow-read \
64
- --allow-sys=hostname \
65
- --allow-write=/var/tmp/youtubei.js,/tmp/invidious-companion.sock \
66
- src/main.ts \
67
- --_version_date="$(git log -1 --format=%ci | awk '{print $1}' | sed s/-/./g)" \
68
- --_version_commit="$(git rev-list HEAD --max-count=1 --abbrev-commit)"
69
-
70
- - name : Verify binary
71
- run : |
72
- if [ -f "${{ steps.binary-name.outputs.name }}" ]; then
73
- echo "✅ Binary created successfully: ${{ steps.binary-name.outputs.name }}"
74
- ls -la "${{ steps.binary-name.outputs.name }}"
75
- else
76
- echo "❌ Binary not found: ${{ steps.binary-name.outputs.name }}"
77
- exit 1
78
- fi
54
+ src/main.ts
79
55
80
56
- name : Create archive
81
57
run : |
@@ -92,16 +68,25 @@ jobs:
92
68
uses : actions/upload-artifact@v4
93
69
with :
94
70
name : binary-${{ matrix.target }}
95
- path : |
96
- ${{ steps.binary-name.outputs.archive_name }}
71
+ path : ${{ steps.binary-name.outputs.archive_name }}
97
72
retention-days : 90
98
73
99
- - name : Upload binaries to latest release
74
+ release :
75
+ runs-on : ubuntu-latest
76
+ needs : build
77
+ permissions :
78
+ contents : write
79
+ steps :
80
+ - name : Download all artifacts
81
+ uses : actions/download-artifact@v4
82
+ with :
83
+ path : artifacts
84
+
85
+ - name : Upload to latest release
100
86
uses : softprops/action-gh-release@v2
101
87
with :
102
88
tag_name : latest
103
- files : |
104
- ${{ steps.binary-name.outputs.archive_name }}
89
+ files : artifacts/**
90
+ overwrite : true
105
91
env :
106
92
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
107
-
0 commit comments