Skip to content

Add manual trigger for CI job #56

Add manual trigger for CI job

Add manual trigger for CI job #56

Workflow file for this run

name: CI
permissions:
contents: read
on:
workflow_dispatch:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
build:
name: 'Build'
runs-on: 'ubuntu-latest'
steps:
- name: Check out code
uses: actions/checkout@v7
- name: Build
uses: ./.github/actions/build
build-and-publish-sonatype-portal-mock:
name: 'Build and publish Sonatype Portal Mock'
runs-on: 'ubuntu-latest'
permissions:
contents: read
packages: write
steps:
- name: Check out code
uses: actions/checkout@v7
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build Sonatype Portal Mock docker image
uses: ./.github/actions/build
with:
gradle-task: ':sonatype-portal-mock:bootBuildImage --imageName ghcr.io/${{ github.repository_owner }}/sonatype-central-portal-mock:latest'
- name: Push Docker image
run: docker push ghcr.io/${{ github.repository_owner }}/sonatype-central-portal-mock:latest
integration-test:
name: 'Integration test'
runs-on: 'ubuntu-latest'
needs:
- build
- build-and-publish-sonatype-portal-mock
services:
sonatype-portal-mock:
image: ghcr.io/${{ github.repository_owner }}/sonatype-central-portal-mock:latest
ports:
- 8080:8080
env:
SERVER_PORT: '8080'
PORTALMOCK_TOKEN_NAME: 'mrsmith'
PORTALMOCK_TOKEN_VALUE: 'morpheus'
PORTALMOCK_DEPLOYMENT_DELAY_BETWEEN_STEPS: '10s'
steps:
- name: Check out code
uses: actions/checkout@v7
- name: Integration test
uses: ./.github/actions/integration-test
with:
sonatype-portal-mock-host: 'sonatype-portal-mock'
sonatype-portal-mock-port: '8080'
token-name: 'mrsmith'
token: 'morpheus'
await-artifact: 'io.github.mhalbritter:sonatype-central-portal-test:0.0.5'
deployment-name: 'test-deployment'
deploy:
name: 'Deploy to repo.spring.io'
runs-on: 'ubuntu-latest'
needs: integration-test
steps:
- name: Check out code
uses: actions/checkout@v7
- name: Build
uses: ./.github/actions/build
with:
gradle-task: '-PdeploymentRepository=$(pwd)/maven-repo publishAllPublicationsToDeploymentRepository'
- name: Deploy to repo.spring.io
uses: spring-io/artifactory-deploy-action@926d7f7cc810569395346bf3a4d91b380b3e355b # v0.0.4
with:
uri: 'https://repo.spring.io'
username: ${{ secrets.ARTIFACTORY_USERNAME }}
password: ${{ secrets.ARTIFACTORY_PASSWORD }}
build-name: ${{ format('maven-central-publish-{0}', github.ref_name)}}
repository: 'libs-snapshot-local'
folder: './maven-repo/'
signing-key: ${{ secrets.GPG_PRIVATE_KEY }}
signing-passphrase: ${{ secrets.GPG_PASSPHRASE }}