Skip to content

Commit

Permalink
add scripts to upload ZIPs to release
Browse files Browse the repository at this point in the history
  • Loading branch information
ahgamut committed Apr 1, 2024
1 parent 581da62 commit e126253
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 0 deletions.
Empty file modified .github/scripts/build-jar.sh
100644 → 100755
Empty file.
13 changes: 13 additions & 0 deletions .github/scripts/collect-jars.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
set -eu

mkdir -p plugins macros
cd plugins

echo "copying shoecomp jar..."
cp ../target/shoecomp-1.0-SNAPSHOT-shaded.jar ./shoecomp-1.0.jar

# https://figshare.com/articles/dataset/Custom_toolbars_and_mini_applications_with_Action_Bar/3397603
echo "downloading action_bar.jar..."
JAR_URL="https://figshare.com/ndownloader/files/42230733"
wget -qO action_bar.jar $JAR_URL
14 changes: 14 additions & 0 deletions .github/scripts/pkg-linux64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
set -eux

FIJI_FILENAME="fiji-linux64.zip"

wget https://downloads.imagej.net/fiji/latest/fiji-linux64.zip -qO "$FIJI_FILENAME"

zip --delete "$FIJI_FILENAME" 'Fiji.app/macros/*'
zip --delete "$FIJI_FILENAME" 'Fiji.app/plugins/*'
zip --delete "$FIJI_FILENAME" 'Fiji.app/scripts/*'
zip --delete "$FIJI_FILENAME" 'Fiji.app/images/about/*'

zip -r macros "$FIJI_FILENAME"
zip -r plugins "$FIJI_FILENAME"
14 changes: 14 additions & 0 deletions .github/scripts/pkg-macosx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
set -eux

FIJI_FILENAME="fiji-macosx.zip"

wget https://downloads.imagej.net/fiji/latest/fiji-macosx.zip -qO "$FIJI_FILENAME"

zip --delete "$FIJI_FILENAME" 'Fiji.app/macros/*'
zip --delete "$FIJI_FILENAME" 'Fiji.app/plugins/*'
zip --delete "$FIJI_FILENAME" 'Fiji.app/scripts/*'
zip --delete "$FIJI_FILENAME" 'Fiji.app/images/about/*'

zip -r macros "$FIJI_FILENAME"
zip -r plugins "$FIJI_FILENAME"
14 changes: 14 additions & 0 deletions .github/scripts/pkg-win64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
set -eux

FIJI_FILENAME="fiji-win64.zip"

wget https://downloads.imagej.net/fiji/latest/fiji-win64.zip -qO "$FIJI_FILENAME"

zip --delete "$FIJI_FILENAME" 'Fiji.app/macros/*'
zip --delete "$FIJI_FILENAME" 'Fiji.app/plugins/*'
zip --delete "$FIJI_FILENAME" 'Fiji.app/scripts/*'
zip --delete "$FIJI_FILENAME" 'Fiji.app/images/about/*'

zip -r macros "$FIJI_FILENAME"
zip -r plugins "$FIJI_FILENAME"
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,27 @@ jobs:
file: target/shoecomp-1.0-SNAPSHOT-shaded.jar
overwrite: true
asset_name: shoecomp-1.0.jar
pkg_fiji:
name: package shoecomp JAR into Fiji
needs: build_jar
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
fiji_target: [linux64, win64, macosx]
steps:
- name: create plugins folder
run: bash ./.github/scripts/collect-jars.sh
- name: package for {{ fiji_target }}
run: bash ./.github/scripts/pkg-{{ fiji_target }}.sh
- name: upload release ZIP
id: upload_assets
uses: svenstaro/upload-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION_NUMBER: ${{ env.VERSION_NUMBER }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: fiji-{{ fiji_target }}.zip
overwrite: true
asset_name: shoecomp-fiji-{{ fiji_target }}.zip
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
plugins/
macros/*.csv
scripts/run-imagej.sh
##############################
Expand Down

0 comments on commit e126253

Please sign in to comment.