-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (69 loc) · 1.93 KB
/
maven-packages.yml
File metadata and controls
81 lines (69 loc) · 1.93 KB
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
name: maven-packages
on:
push:
branches:
- main
tags:
- "v[0-9]+*"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # for tags
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B clean package --no-transfer-progress --file pom.xml
- name: Run tests
run: mvn -B test --no-transfer-progress --file pom.xml
env:
WAVESPEED_API_KEY: ${{ secrets.WAVESPEED_API_KEY }}
- run: ls -lh target/*.jar
- uses: actions/upload-artifact@v4
with:
name: maven-packages
path: |
target/*.jar
# publish to GitHub Release
gh_release:
name: gh_release
needs: build
runs-on: ubuntu-latest
permissions: write-all
timeout-minutes: 60
defaults:
run:
shell: bash
steps:
- uses: actions/download-artifact@v4
with:
path: dist
- run: ls -R dist/
# create nightly release if it's a push to main
- if: github.repository == 'WaveSpeedAI/wavespeed-java' && github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Nightly Release
uses: andelf/nightly-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly
name: 'Nightly Release $$'
prerelease: true
body: 'TODO: Add nightly release notes'
files: |
dist/*/*.jar
# create release if it's a tag like vx.y.z
- if: github.repository == 'WaveSpeedAI/wavespeed-java' && github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v')
name: Release
uses: softprops/action-gh-release@v1
with:
files: |
dist/*/*.jar