Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: updated to the re-usable release workflow #137

Merged
merged 2 commits into from
Feb 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 5 additions & 78 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,81 +7,8 @@ on:
types: [prereleased]

jobs:
on-release:
runs-on: ubuntu-latest

# The cimg-mvn-cache is an image containing a .m2 folder warmed-up
# with common Jahia dependencies. Using this prevents maven from
# downloading the entire world when building.
# More on https://github.com/Jahia/cimg-mvn-cache
container:
image: jahia/cimg-mvn-cache:ga_cimg_openjdk_11.0.20-node
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

steps:
# This seems to be necessary, for unclear reasons, but a similar setup
# was done on the ckeditor repo
- name: Add safe directory
shell: bash
run: |
git config --global --add safe.directory /__w/tools/tools

# Providing the SSH PRIVATE of a user part of an admin group
# is necessary to bypass PR checks
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.GH_SSH_PRIVATE_KEY_JAHIACI }}

# Setting up the SSH agent to be able to commit back to the repository
# https://github.com/webfactory/ssh-agent
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.GH_SSH_PRIVATE_KEY_JAHIACI }}

- uses: jahia/jahia-modules-action/release@v2
name: Release Module
with:
github_slug: Jahia/tools
primary_release_branch: master
release_id: ${{ github.event.release.id }}
release_version: ${{ github.event.release.tag_name }}
github_api_token: ${{ secrets.GH_API_TOKEN }}
nexus_username: ${{ secrets.NEXUS_USERNAME }}
nexus_password: ${{ secrets.NEXUS_PASSWORD }}

- uses: jahia/jahia-modules-action/update-signature@v2
with:
nexus_username: ${{ secrets.NEXUS_USERNAME }}
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
nexus_enterprise_releases_url: ${{ secrets.NEXUS_ENTERPRISE_RELEASES_URL }}
force_signature: true

- uses: jahia/jahia-modules-action/release-publication@v2
name: Publish Module
with:
module_id: tools
release_version: ${{ github.event.release.tag_name }}
nexus_username: ${{ secrets.NEXUS_USERNAME }}
nexus_password: ${{ secrets.NEXUS_PASSWORD }}

# Tmate only starts if any of the previous steps fails.
# Be careful since it also means that if a step fails the workflow will
# keep running until it reaches the timeout
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15

sbom:
name: SBOM processing
needs: on-release
runs-on: ubuntu-latest
container:
image: cyclonedx/cyclonedx-cli:0.24.2
steps:
- uses: jahia/jahia-modules-action/sbom-processing@v2
with:
dependencytrack_hostname: ${{ vars.DEPENDENCYTRACK_HOSTNAME }}
dependencytrack_apikey: ${{ secrets.DEPENDENCYTRACK_APIKEY }}
release-module:
uses: Jahia/jahia-modules-action/.github/workflows/release-module.yml@v2
secrets: inherit
with:
primary_release_branch: "master"
Loading