ci: add publish dependencies flow #20
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
name: Prepare Release | |
on: | |
workflow_call: | |
inputs: | |
version: | |
description: the version to be released. If it ends with '.0' a proper release is created, bugfix otherwise | |
required: true | |
type: string | |
jobs: | |
Dependency-Validation: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout$4 | |
- name: check for restricted / rejected dependencies | |
run: | | |
grep -hs -e restricted -e rejected DEPENDENCIES > unacceptable-dependencies | |
if [ -s unacceptable-dependencies ]; then | |
echo "Some dependencies are not in the expected status:" | |
cat unacceptable-dependencies | |
fi | |
Prepare-Release: | |
needs: [ Dependency-Validation ] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set release type | |
shell: bash | |
id: vars | |
run: | | |
type=bugfix | |
if [[ ${{ inputs.version }} == *0 ]] | |
then | |
type=release | |
fi | |
echo "type=$type" >> $GITHUB_OUTPUT | |
- name: create ${{ steps.vars.outputs.type }}/${{ inputs.version }} branch | |
shell: bash | |
run: | | |
git config user.name "eclipse-edc-bot" | |
git config user.email "[email protected]" | |
git checkout -b ${{ steps.vars.outputs.type }}/${{ inputs.version }} | |
git push -f origin ${{ steps.vars.outputs.type }}/${{ inputs.version }} | |
- uses: eclipse-edc/.github/.github/actions/set-project-version@main | |
with: | |
version: ${{ inputs.version }} | |
- name: Create prepare/${{ inputs.version }} branch and commit changes | |
run: | | |
git config user.name "eclipse-edc-bot" | |
git config user.email "[email protected]" | |
git checkout -b prepare/${{ inputs.version }} | |
git add . | |
git commit -m "Prepare ${{ steps.vars.outputs.type }} ${{ inputs.version }}" | |
git push origin prepare/${{ inputs.version }} | |
- name: Create pull request | |
uses: thomaseizinger/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
head: prepare/${{ inputs.version }} | |
base: ${{ steps.vars.outputs.type }}/${{ inputs.version }} | |
title: "build: Prepare ${{ steps.vars.outputs.type }} ${{ inputs.version }}" | |
reviewers: ${{ github.actor }} | |
body: |- | |
This PR was created in response to a manual trigger of the prepare release. | |
Versions have been bumped in to ${{ inputs.version }}. | |
**PLEASE NOTE: you have to close the PR and re-open it in order to run the checks.** | |
Details at: https://github.com/orgs/community/discussions/65321 | |
Merging this PR will create a ${{ steps.vars.outputs.type }} branch for the ${{ inputs.version }} version. | |
Release workflow will need to be triggered manually. |