Skip to content

Commit 59df828

Browse files
committed
fix: releasing files with matrix
1 parent 85cd8f1 commit 59df828

File tree

1 file changed

+19
-34
lines changed

1 file changed

+19
-34
lines changed

.github/workflows/release-binaries.yaml

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ on:
55
branches:
66
- main
77
- master
8-
workflow_dispatch: # Allow manual triggering
8+
workflow_dispatch:
99

1010
jobs:
11-
build-rolling-release:
11+
build:
1212
runs-on: ubuntu-latest
1313
permissions:
1414
contents: write
15-
1615
strategy:
1716
matrix:
1817
target:
@@ -26,7 +25,7 @@ jobs:
2625
- name: Setup repo
2726
uses: actions/checkout@v5
2827
with:
29-
fetch-depth: 0 # Fetch full history for git commands
28+
fetch-depth: 0
3029

3130
- name: Setup Deno
3231
uses: denoland/setup-deno@v2
@@ -36,7 +35,6 @@ jobs:
3635
- name: Set binary name
3736
id: binary-name
3837
run: |
39-
echo "Building for target: ${{ matrix.target }}"
4038
case "${{ matrix.target }}" in
4139
*-windows-*)
4240
echo "name=invidious_companion.exe" >> $GITHUB_OUTPUT
@@ -47,35 +45,13 @@ jobs:
4745
echo "archive_name=invidious_companion-${{ matrix.target }}.tar.gz" >> $GITHUB_OUTPUT
4846
;;
4947
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)"
5248
5349
- name: Build binary
5450
run: |
5551
deno compile \
5652
--target="${{ matrix.target }}" \
57-
--include ./src/lib/helpers/youtubePlayerReq.ts \
58-
--include ./src/lib/helpers/getFetchClient.ts \
5953
--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
7955
8056
- name: Create archive
8157
run: |
@@ -92,16 +68,25 @@ jobs:
9268
uses: actions/upload-artifact@v4
9369
with:
9470
name: binary-${{ matrix.target }}
95-
path: |
96-
${{ steps.binary-name.outputs.archive_name }}
71+
path: ${{ steps.binary-name.outputs.archive_name }}
9772
retention-days: 90
9873

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
10086
uses: softprops/action-gh-release@v2
10187
with:
10288
tag_name: latest
103-
files: |
104-
${{ steps.binary-name.outputs.archive_name }}
89+
files: artifacts/**
90+
overwrite: true
10591
env:
10692
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107-

0 commit comments

Comments
 (0)