All Projects → samuelmeuli → Action Maven Publish

samuelmeuli / Action Maven Publish

📦 GitHub Action for automatically publishing Maven packages

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Action Maven Publish

Aliyungradleconfig
自用的安卓开源项目工程模板。阿里云远程仓库加速,发布到maven仓库、上传到jcenter,代码混淆、资源混淆,持续集成(CI),多渠道自动打包。在天朝使用jcenter、mavenCentral及google三个远程仓库,Gradle Sync太慢?一招教你配置阿里云镜像源。init.d/init.gradle
Stars: ✭ 37 (-43.94%)
Mutual labels:  maven, ci
sunshine
Sunshine allows you to manage suits of your automated tests directly from Java code.
Stars: ✭ 12 (-81.82%)
Mutual labels:  maven, ci
Example Java Maven
Stars: ✭ 48 (-27.27%)
Mutual labels:  maven
K8s Config Projector
Create Kubernetes ConfigMaps from configuration files
Stars: ✭ 61 (-7.58%)
Mutual labels:  ci
Radar Covid Backend Configuration Server
Radar COVID Configuration Service
Stars: ✭ 56 (-15.15%)
Mutual labels:  maven
Springboot Beginner
🔰 📝 这可能是流程最清晰、代码最干净、注释最详细的 SpringBoot 入门项目咯,对于初学 SpringBoot 的同学非常具有参考与学习价值哟 ~
Stars: ✭ 51 (-22.73%)
Mutual labels:  maven
Springboard
Spring Boot based production grade starter kit.
Stars: ✭ 59 (-10.61%)
Mutual labels:  maven
Danyuan Application
初学者 spirng-boot版本
Stars: ✭ 47 (-28.79%)
Mutual labels:  maven
Kube Score
Kubernetes object analysis with recommendations for improved reliability and security
Stars: ✭ 1,128 (+1609.09%)
Mutual labels:  ci
Maven Site
Apache Maven site
Stars: ✭ 54 (-18.18%)
Mutual labels:  maven
Flow Core X
Powerful and user-friendly CI / CD server with high availability, parallel build, agent scaling
Stars: ✭ 1,108 (+1578.79%)
Mutual labels:  ci
Jgo
Launch Java code from the CLI, installation-free. ☕
Stars: ✭ 53 (-19.7%)
Mutual labels:  maven
Npm Cache Resource
Concourse resource for caching dependencies
Stars: ✭ 51 (-22.73%)
Mutual labels:  ci
Animal Sniffer
Stars: ✭ 59 (-10.61%)
Mutual labels:  maven
Metac
It is metacontroller and more
Stars: ✭ 50 (-24.24%)
Mutual labels:  ci
Simpleci
Simple docker-based continuous integration system
Stars: ✭ 61 (-7.58%)
Mutual labels:  ci
Abs cd
CI/CD for the Arch build system with webinterface.
Stars: ✭ 48 (-27.27%)
Mutual labels:  ci
Drombler Fx
Drombler FX - the modular application framework for JavaFX.
Stars: ✭ 52 (-21.21%)
Mutual labels:  maven
Bitrise android
Unofficial Bitrise client for Android
Stars: ✭ 57 (-13.64%)
Mutual labels:  ci
Maven Enforcer
Apache Maven Enforcer (Plugin)
Stars: ✭ 64 (-3.03%)
Mutual labels:  maven

Maven Publish Action

GitHub Action for automatically publishing Maven packages

Overview

This action…

  • Executes the Maven deploy lifecycle phase
  • Provides Maven with your GPG key and passphrase so your artifacts can be signed using maven-gpg-plugin
  • Provides Maven with your Nexus credentials so it can deploy and release your project

It will also use the deploy Maven profile if you've defined one (in case you want to perform certain steps only when deploying).

Setup

Deployment

It's recommended to publish using the Nexus Staging Maven Plugin, which greatly simplifies the process. You can follow this guide for a simple configuration.

Make sure your project is correctly configured for deployment before continuing with the next step.

Workflow

Secrets

In your project's GitHub repository, go to Settings → Secrets. On this page, set the following variables:

  • nexus_username: Username (not email!) for your Nexus repository manager account
  • nexus_password: Password for your Nexus account (or, even better, use the auth token instead)

Signing your artifact using GPG is optional, but recommended. If you choose to use GPG, add the following secrets:

  • gpg_private_key: GPG private key for signing the published artifacts:
    • Run gpg --list-secret-keys and copy the ID of the key you'd like to use
    • Export the key with gpg -a --export-secret-keys KEY_ID (and replace KEY_ID with the ID you copied)
  • gpg_passphrase: Passphrase for the GPG key

If you sign your artifacts, make sure the maven-gpg-plugin is configured as described here.

Workflow file

Create a GitHub workflow file (e.g. .github/workflows/release.yml) in your repository. Use the following configuration, which tells GitHub to use the Maven Publish Action when running your CI pipeline. The steps are self-explanatory:

name: Release

# Run workflow on commits to the `master` branch
on:
  push:
    branches:
      - master

jobs:
  release:
    runs-on: ubuntu-18.04
    steps:
      - name: Check out Git repository
        uses: actions/[email protected]

      - name: Install Java and Maven
        uses: actions/[email protected]
        with:
          java-version: 11

      - name: Release Maven package
        uses: samuelmeuli/[email protected]
        with:
          gpg_private_key: ${{ secrets.gpg_private_key }}
          gpg_passphrase: ${{ secrets.gpg_passphrase }}
          nexus_username: ${{ secrets.nexus_username }}
          nexus_password: ${{ secrets.nexus_password }}

The action will now run every time you push to master.

Configuration

In addition to the input variables listed above, the action can be configured with the following options:

  • directory: Directory of the Maven project to deploy. Default: Repository root
  • maven_profiles: Active Maven profiles. Default: "deploy"
  • maven_goals_phases: Maven goals and build phases to execute. Default: "clean deploy"
  • maven_args: Additional arguments to pass to the Maven command. Default: ""
  • server_id: The default Nexus instance used by this action is OSSRH. If you are deploying to a different Nexus instance, you can specify the server ID you've used in your project's POM file (in the nexus-staging-maven-plugin and distributionManagement configurations) here

Development

Suggestions and contributions are always welcome! Please discuss larger changes via issue before submitting a pull request.

Related

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].