fix: use github-script to upload to release

This commit is contained in:
tkmxqrdxddd
2026-03-17 21:06:01 +01:00
parent 8b007be08a
commit 1166e34804

View File

@@ -4,7 +4,6 @@ on:
push: push:
tags: tags:
- 'v*' - 'v*'
workflow_dispatch:
jobs: jobs:
release: release:
@@ -81,10 +80,24 @@ jobs:
name: davinci-video-converter-${{ matrix.arch }}.deb name: davinci-video-converter-${{ matrix.arch }}.deb
path: davinci-video-converter_*.deb path: davinci-video-converter_*.deb
- name: Create Release - name: Upload to GitHub Release
uses: softprops/action-gh-release@v1 uses: actions/github-script@v7
with: with:
generate_release_notes: true script: |
tag_name: ${{ github.ref_name }} const fs = require('fs');
name: Version ${{ github.ref_name }} const tag = context.ref.replace('refs/tags/', '');
files: davinci-video-converter_*.deb const debFile = fs.readdirSync('.').find(f => f.endsWith('${{ matrix.arch }}.deb'));
const release = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: tag
});
await github.rest.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release.data.id,
name: debFile,
data: fs.readFileSync(debFile)
});