forked from loafle/openapi-generator-original
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/cache dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
61 lines
1.6 KiB
YAML
61 lines
1.6 KiB
YAML
name: Release to Maven Central (snapshot, stable)
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Set up JDK 11
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
java-version: 11
|
|
distribution: 'zulu'
|
|
- name: Cache Maven packages
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: ~/.m2
|
|
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
|
restore-keys: ${{ runner.os }}-m2
|
|
- name: Build
|
|
run: ./mvnw clean install -DskipTests=true
|
|
#run: ./mvnw clean install
|
|
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
name: Publish to Maven Central
|
|
needs: build
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- id: install-secret-key
|
|
name: Install gpg secret key
|
|
run: |
|
|
cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import
|
|
gpg --list-secret-keys --keyid-format LONG
|
|
|
|
- name: Set up Maven Central Repository
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
java-version: 11
|
|
distribution: 'zulu'
|
|
server-id: central
|
|
server-username: MAVEN_USERNAME
|
|
server-password: MAVEN_PASSWORD
|
|
|
|
- name: Publish package
|
|
run: ./mvnw -DskipTests=true --batch-mode -P release -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} deploy
|
|
env:
|
|
MAVEN_USERNAME: ${{ secrets.OSS_USERNAME }}
|
|
MAVEN_PASSWORD: ${{ secrets.OSS_PASSWORD }} |