Skip to content

Commit

Permalink
Add workflow for drafting releases
Browse files Browse the repository at this point in the history
  • Loading branch information
planger committed Dec 22, 2023
1 parent 7681560 commit 55d893d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Draft Release

on:
release:
types: [drafted]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build (mvn package)
run: mvn -B package --file com.eclipsesource.megit.parent/pom.xml
- name: Upload each zip file as a separate asset
run: |
for zipfile in ./com.eclipsesource.megit.product/target/products/*.zip; do
asset_name=$(basename $zipfile)
echo "Uploading $asset_name"
curl \
-X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: $(file -b --mime-type $zipfile)" \
--data-binary @$zipfile \
${{ github.event.release.upload_url }}?name=$asset_name
done

0 comments on commit 55d893d

Please sign in to comment.