-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (36 loc) · 1.63 KB
/
Copy pathgithub-publishpackage.yml
File metadata and controls
37 lines (36 loc) · 1.63 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
# ref:
# Publishing packages to GitHub Packages:
# https://docs.github.com/en/actions/use-cases-and-examples/publishing-packages/publishing-java-packages-with-maven#publishing-packages-to-github-packages
# Events that trigger workflows:
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#release
# Using events to trigger workflows - Using activity types and filters with multiple events:
# https://docs.github.com/en/enterprise-cloud@latest/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#using-activity-types-and-filters-with-multiple-events
#
# Upgrade to Automatic token authentication, no need for personal access token anymore
# ref:
# https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-a-registry-using-a-personal-access-token
#
name: Package Auto Publish
run-name: 'Package Publish #${{github.run_number}}'
on:
workflow_dispatch:
jobs:
Build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: setup jdk 21
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '21'
server-id: 'github-package'
- name: checkout repo
uses: actions/checkout@v4
- name: deploy project with maven
run: mvn deploy -Pdeploy-github
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_MAVEN_URL: https://maven.pkg.github.com/${{github.repository}}