-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21c2d81
commit 54c3f23
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Update Release Draft | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
artifact_name: | ||
required: true | ||
type: string | ||
default: "FicsItNetworks" | ||
workflow_call: | ||
inputs: | ||
artifact_name: | ||
required: true | ||
type: string | ||
|
||
permissions: | ||
actions: read | ||
|
||
jobs: | ||
update-release-draft: | ||
name: Update Release Draft | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Find Release Draft | ||
uses: actions/github-script@v7 | ||
id: find-release-draft | ||
with: | ||
script: | | ||
const response = await github.rest.repos.listReleases({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
per_page: 1, | ||
}); | ||
const release = response.data[0]; | ||
if (!release.draft) { | ||
core.setFailed('Found Release is not a draft!'); | ||
return; | ||
} | ||
return release.id; | ||
- name: Find FicsIt-Networks Binary | ||
uses: actions/github-script@v7 | ||
id: find-ficsit-networks | ||
with: | ||
script: | | ||
const response = await github.rest.actions.listArtifactsForRepo({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
per_page: 1, | ||
name: "${{ inputs.artifact_name }}" | ||
}); | ||
return response.data.artifacts[0].workflow_run.id; | ||
- name: Download FicsIt-Networks | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ inputs.artifact_name }} | ||
run-id: ${{ steps.find-ficsit-networks.outputs.result }} | ||
path: ${{ github.workspace }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Upload To Github Release | ||
uses: xresloader/[email protected] | ||
with: | ||
file: "*.zip" | ||
overwrite: true | ||
release_id: ${{ steps.find-release-draft.outputs.result }} |