Skip to content

Commit ba2b5ba

Browse files
committed
feat:add the builtin token
1 parent 7115ddb commit ba2b5ba

File tree

1 file changed

+15
-43
lines changed

1 file changed

+15
-43
lines changed

.github/workflows/publish.yml

Lines changed: 15 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,36 @@
1-
name: Publish Common Events Package
1+
name: Publish Java Package
22

33
on:
44
push:
55
branches:
66
- main
7-
- master
8-
tags:
9-
- 'v*'
10-
release:
11-
types: [created]
12-
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
packages: write
1311

1412
jobs:
15-
publish:
13+
build-and-publish:
1614
runs-on: ubuntu-latest
17-
permissions:
18-
contents: read
19-
packages: write
2015

2116
steps:
22-
- name: Checkout code
17+
- name: Checkout repository
2318
uses: actions/checkout@v4
2419

2520
- name: Set up JDK 17
2621
uses: actions/setup-java@v4
2722
with:
28-
java-version: '17'
29-
distribution: 'temurin'
23+
distribution: temurin
24+
java-version: 17
3025
cache: maven
31-
32-
- name: Extract version from pom.xml
33-
id: version
34-
run: |
35-
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
36-
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
37-
echo "Package version: $VERSION"
26+
server-id: github
27+
server-username: GITHUB_ACTOR
28+
server-password: GITHUB_TOKEN
3829

3930
- name: Build with Maven
40-
run: mvn -B clean package --file pom.xml
41-
42-
- name: Run tests
43-
run: mvn -B test --file pom.xml
44-
45-
- name: Configure Maven settings
46-
uses: actions/setup-java@v4
47-
with:
48-
java-version: '17'
49-
distribution: 'temurin'
50-
server-id: github
51-
server-username: ACTOR_GITHUB
52-
server-password: TOKEN_GITHUB
31+
run: mvn --batch-mode clean package
5332

5433
- name: Publish to GitHub Packages
55-
run: mvn -B deploy --file pom.xml
34+
run: mvn --batch-mode deploy
5635
env:
57-
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
58-
59-
- name: Upload artifact
60-
uses: actions/upload-artifact@v4
61-
with:
62-
name: common-events-${{ steps.version.outputs.VERSION }}
63-
path: target/*.jar
64-
retention-days: 30
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)