New CI workflow #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2024 lbruun.net. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
name: CI workflow | |
on: | |
push: | |
# Only on push of commits, not push of tags (we have 'release' for that) | |
branches: | |
- "*" | |
pull_request: | |
workflow_dispatch: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Java and Maven | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
server-id: maven-central # Value of <id> in <server> section of generated settings.xml | |
server-username: MAVEN_CENTRAL_USERNAME # env variable for username in <server> section of generated settings.xml | |
server-password: MAVEN_CENTRAL_PASSWORD # env variable for password in <server> section of generated settings.xml | |
gpg-private-key: ${{ secrets.MAVEN_CENTRAL_GPG_SECRET_KEY }} # Value of the GPG private key to import | |
gpg-passphrase: MAVEN_CENTRAL_GPG_PASSPHRASE # env variable for GPG private key passphrase | |
- name: Maven execution | |
run: .github/scripts/maven-execution.sh | |
env: | |
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} # Must be the token "username", not the username for the UI | |
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} # Must be the token "password", not the password for the UI | |
MAVEN_CENTRAL_GPG_PASSPHRASE: ${{ secrets.MAVEN_CENTRAL_GPG_PASSPHRASE }} |