-
-
Notifications
You must be signed in to change notification settings - Fork 24
86 lines (72 loc) · 3.26 KB
/
jar.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
name: Create library jar
on:
push:
branches:
- main
env:
initial_description: |
:construction: This is pre-release code for people who want to help test [what is going into the next release](https://github.com/Deep-Symmetry/beat-link/blob/master/CHANGELOG.md).
> Don’t download this if you aren’t comfortable testing code while it is under active development! Instead, look at the [latest release](https:///github.com/Deep-Symmetry/beat-link/releases/latest).
:calendar: **Ignore the “release date” above!** Because this is a snapshot release, the executables below (you may need to click to expand the Assets) will change frequently—whenever new code is pushed to the project—so you will want to _download the latest version every time you work with one_. The date you see _on each asset row_ shows you when it was last updated. Source code archive assets are not useful for snapshot releases, they will always reflect the state of the project when the snapshots began.
jobs:
build_jar:
name: Build library jar
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Check out main branch
uses: actions/checkout@v3
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.GUIDE_SSH_KEY }}
known_hosts: 'deepsymmetry.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMKq8T1IXQHNYLgO715YbxTXoVxEsJcha9h1lxyOXpa'
- name: Prepare Java
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'corretto'
- name: Determine release tag, library jar name, and snapshot status
run: |
PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
RELEASE_TAG="v$PROJECT_VERSION"
HUMAN_VERSION=${PROJECT_VERSION/SNAPSHOT/Preview}
echo "release_tag=$RELEASE_TAG" >> $GITHUB_ENV
echo "release_name=$PROJECT_VERSION" >> $GITHUB_ENV
echo "built_name=beat-link-$PROJECT_VERSION.jar" >> $GITHUB_ENV
echo "artifact_name=beat-link-$HUMAN_VERSION.jar" >> $GITHUB_ENV
if [[ $RELEASE_TAG =~ .*-SNAPSHOT ]]
then
echo "release_snapshot=true" >> $GITHUB_ENV
else
echo "release_snapshot=false" >> $GITHUB_ENV
fi
- name: Cache Maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-mvn-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-mvn-
- name: Install dependencies and compile
run: mvn compile
- name: Build library jar
run: |
mvn package
mv target/$built_name ./$artifact_name
- name: Upload library jar
if: success()
uses: Xotl/cool-github-releases@v1
with:
mode: update
tag_name: ${{ env.release_tag }}
release_name: ${{ env.release_name }}
isPrerelease: ${{ env.release_snapshot }}
replace_assets: ${{ env.release_snapshot }}
assets: ${{ env.artifact_name }}
github_token: ${{ github.token }}
initial_mrkdwn: ${{ env.initial_description }}
- name: Publish the JavaDoc
env:
GUIDE_SSH_KEY: ${{ secrets.GUIDE_SSH_KEY }}
run: bash .github/scripts/deploy_docs.sh