-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (109 loc) · 4.12 KB
/
release-pointmark.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Releases
on:
push:
# Sequence of patterns matched against refs/tags
branches:
- main
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
# name: Create Release
jobs:
release_pointmark:
name: Release Pointmark
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
id: release_pointmark
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: JDK Setup
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
- name: Build Project
run: |
pwd
ls -la
mvn clean
- name: Package JAR
run: |
pwd
ls -la
mvn package
ls -la target
- name: Upload JAR Artifact
uses: actions/upload-artifact@v2
with:
name: pointmark-1.0.${{ env.VERSION_NUMBER }}.jar
path: target/CoordinateExporter-0.1.0-SNAPSHOT.jar
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v1.0.${{ github.run_number }}
release_name: v1.0.${{ github.run_number }}
body: Packaging for PointMark
- name: Set VERSION_NUMBER
id: set_version_number
run: |
echo "VERSION_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
echo "::set-output name=version_number::${{ github.run_number }}"
shell: bash
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: target/CoordinateExporter-0.1.0-SNAPSHOT.jar
asset_name: pointmark-1.0.${{ env.VERSION_NUMBER }}.jar
asset_content_type: application/java-archive
build_jars:
name: package pointmark into FIJI
runs-on: ubuntu-latest
needs: release_pointmark
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: Download JAR Artifact
uses: actions/download-artifact@v2
with:
name: pointmark-1.0.${{ env.VERSION_NUMBER }}.jar
path: target/
- name: copy plugins and macros
run: bash ./.github/scripts/collect-jars.sh ${{ needs.release_pointmark.outputs.version_number }}
- name: package for ${{ matrix.fiji_target }}
run: bash ./.github/scripts/pkg-${{ matrix.fiji_target }}.sh
- 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: v1.0.${{ github.run_number }}
release_name: v1.0.${{ github.run_number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}