Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,37 @@ jobs:
name: MeetingAssistant
path: release.zip
retention-days: 30

- name: Get existing Release upload URL
id: get_release
uses: actions/github-script@v6
with:
script: |
const tag = context.ref.startsWith("refs/tags/") ? context.ref.substring("refs/tags/".length) : context.ref;
core.info(`Using tag: ${tag}`);
const release = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: tag
});
const uploadUrl = release.data.upload_url; // 不要去掉 {?name,label}
core.info(`Found release with upload_url: ${uploadUrl}`);
return uploadUrl;

- name: Debug GITHUB_TOKEN
shell: powershell
run: |
if ($env:GITHUB_TOKEN) {
Write-Host "GITHUB_TOKEN is defined."
} else {
Write-Host "GITHUB_TOKEN is NOT defined."
}

- name: Create Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
release.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}