mirror of
https://github.com/tkmxqrdxddd/davinci-video-converter
synced 2026-03-29 23:35:32 +02:00
fix: use github-script to upload to release
This commit is contained in:
27
.github/workflows/release.yml
vendored
27
.github/workflows/release.yml
vendored
@@ -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)
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user