-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (64 loc) · 1.91 KB
/
pkg-fiji.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: package pointmark into FIJI
on:
workflow_dispatch:
release:
types: [created]
create:
tags:
- 'v*'
jobs:
build_jar:
name: package pointmark into FIJI
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
fiji_target: [linux64, win64, macosx]
steps:
- name: checkout repo
id: checkout_repo
uses: actions/checkout@v4
- name: Fetch all tags
run: git fetch --tags
- name: List all tags
run: git tag
- name: setup JDK
uses: actions/setup-java@v4
id: jdk_setup
with:
distribution: 'adopt'
java-version: '11'
- name: build JAR
run: bash ./.github/scripts/build-jar.sh
- name: copy plugins and macros
run: bash ./.github/scripts/collect-jars.sh
- name: package for ${{ matrix.fiji_target }}
run: bash ./.github/scripts/pkg-${{ matrix.fiji_target }}.sh
- name: Check if tag exists
id: check_tag
run: |
TAG_NAME="v${GITHUB_RUN_NUMBER}"
if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
echo "TAG_EXISTS=true" >> $GITHUB_ENV
else
echo "TAG_EXISTS=false" >> $GITHUB_ENV
fi
- name: Create and push tag if it doesn't exist
if: env.TAG_EXISTS == 'false'
run: |
TAG_NAME="v${GITHUB_RUN_NUMBER}"
git tag $TAG_NAME
git push origin $TAG_NAME
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: upload release ZIP
id: upload_zip
uses: softprops/action-gh-release@v2
with:
fail_on_unmatched_files: true
prerelease: true
files: fiji-${{ matrix.fiji_target }}.zip
tag_name: "v${{ github.run_number }}"
release_name: Release v${{ github.run_number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}