Skip to content

Commit

Permalink
build: upload plugin and native libs to draft release as assets.
Browse files Browse the repository at this point in the history
  • Loading branch information
JChrist committed Jan 15, 2025
1 parent 5c38a4e commit dce6147
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/draft_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
needs: buildRustLibrary
outputs:
version: ${{ steps.properties.outputs.version }}
filename: ${{ steps.artifact.outputs.filename }}
steps:
# Check out current repository
- name: Fetch Sources
Expand Down Expand Up @@ -137,11 +138,9 @@ jobs:
permissions:
contents: write
steps:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4

# Remove old release drafts by using the curl request for the available releases with draft flag
- name: Remove Old Release Drafts
env:
Expand All @@ -150,7 +149,16 @@ jobs:
gh api repos/{owner}/{repo}/releases \
--jq '.[] | select(.draft == true) | .id' \
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
- name: Download native library
uses: actions/download-artifact@v4
with:
name: jrad
path: ./artifacts
- name: Download built plugin
uses: actions/download-artifact@v4
with:
name: ${{ needs.buildPluginArtifact.outputs.filename }}
path: ./
# Create new release draft - which is not publicly visible and requires manual acceptance
- name: Create Release Draft
env:
Expand All @@ -160,3 +168,14 @@ jobs:
--draft \
--title "v${{ needs.buildPluginArtifact.outputs.version }}" \
--generate-notes
- name: Upload draft release assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# first identify draft release id. we cannot use just the draft release tag,
# as it may conflict with existing release
DRAFT_RELEASE_ID=$(gh api repos/{owner}/{repo}/releases --jq '.[] | select(.draft == true) | .id')
gh release upload "${DRAFT_RELEASE_ID}" ./build/distributions/* --clobber
# zip up the native artifacts
zip -r jrad.zip ./artifacts
gh release upload "${DRAFT_RELEASE_ID}" jrad.zip --clobber
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ video
/out/
.intellijPlatform/
*.iml
target/
target/
macos-sdk-11.3/
META-INF/jrad/
artifacts/

0 comments on commit dce6147

Please sign in to comment.