Skip to content

Commit

Permalink
feat: Update release draft CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Panakotta00 committed Oct 26, 2024
1 parent 21c2d81 commit 54c3f23
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/update-release-draft.yml
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 }}

0 comments on commit 54c3f23

Please sign in to comment.