Skip to content

Commit f3e8cf2

Browse files
committed
java-api : workflow githubaction init
1 parent 26b21af commit f3e8cf2

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/workflow.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: my first workflow
2+
on:
3+
push:
4+
branches: [ main ]
5+
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-java@v1
12+
with:
13+
java-version: 17
14+
settings-path: ".m2/"
15+
- uses: actions/cache@v2
16+
with:
17+
path: ~/.m2/repository
18+
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
19+
- name: Publish package
20+
run: mvn $MAVEN_CLI_OPTS clean deploy
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
24+
- name: Copying target jar
25+
run: |
26+
mkdir myTarget
27+
cp target/*.jar myTarget
28+
- name: Uploading jar
29+
uses: actions/upload-artifact@v2
30+
with:
31+
name: myPackage
32+
path: myTarget

0 commit comments

Comments
 (0)