Skip to content

Merge pull request #173 from freenowtech/force-sauron-service-release #70

Merge pull request #173 from freenowtech/force-sauron-service-release

Merge pull request #173 from freenowtech/force-sauron-service-release #70

name: Release Plugins
on:
push:
branches:
- main
paths:
- plugins/**
jobs:
list-projects:
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') }}
runs-on: ubuntu-latest
outputs:
paths: ${{ steps.list-plugins.outputs.paths }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Check for changes
uses: dorny/paths-filter@v2
id: changes
with:
list-files: 'json'
filters: |
plugins:
- 'plugins/**'
- name: List Plugins
id: list-plugins
run: echo "::set-output name=paths::$(jq -c '[.[] | match("(plugins\/[a-zA-Z0-9-_]*\/)").captures[0].string] | unique | sort' <<< '${{ steps.changes.outputs.plugins_files }}' )"
package-and-publish:
needs: list-projects
strategy:
max-parallel: 1
matrix:
path: ${{ fromJSON(needs.list-projects.outputs.paths) }}
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Setup Java 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Check for changes
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
src:
- '${{ matrix.path }}**'
- name: Update local git repository. It is needed because other jobs might have released a new version
run: git pull
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Maven release and publish
if: steps.changes.outputs.src == 'true'
uses: qcastel/[email protected]
continue-on-error: true
with:
access-token: ${{ secrets.FREE_NOW_GITHUB_ACCESS_TOKEN }}
release-branch-name: "main"
maven-args: "-DskipTests -DskipITs"
git-release-bot-name: "free-now-github"
git-release-bot-email: "[email protected]"
git-skip-sanity-check: true
ssh-private-key: ${{ secrets.FREE_NOW_GITHUB_PRIVATE_KEY }}
maven-project-folder: ${{ matrix.path }}
maven-repo-server-id: ossrh
maven-repo-server-username: ${{ secrets.FREE_NOW_MAVEN_USERNAME }}
maven-repo-server-password: ${{ secrets.FREE_NOW_MAVEN_ACCESS_TOKEN }}
gpg-enabled: true
gpg-key-id: ${{ secrets.FREE_NOW_GPG_KEY_ID }}
gpg-key: ${{ secrets.FREE_NOW_GPG_KEY }}
gpg-passphrase: ${{ secrets.FREE_NOW_GPG_PASSPHRASE }}
env:
JAVA_HOME: /usr/lib/jvm/java-11-openjdk/