-
Notifications
You must be signed in to change notification settings - Fork 6
35 lines (33 loc) · 916 Bytes
/
main.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
name: Java CI-CD with Gradle
on:
push:
tags:
- '*'
jobs:
build:
# 配置权限
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'zulu'
cache: gradle
- name: "Build with Gradle"
run: ./gradlew buildPlugin
- name: "Copy jar to staging"
run: mkdir staging && cp build/libs/*.jar staging/
- name: "Build & test"
run: |
TAG=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
echo "done!"
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ steps.build.outputs.TAG }}"
prerelease: false
files: |
staging/*.jar