Skip to content

chore(deps): pin all GitHub Actions to allowed SHA versions #3

chore(deps): pin all GitHub Actions to allowed SHA versions

chore(deps): pin all GitHub Actions to allowed SHA versions #3

name: Prepare Release

Check failure on line 1 in .github/workflows/prepare-release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/prepare-release.yml

Invalid workflow file

(Line: 31, Col: 15): Expected format {org}/{repo}[/path]@ref. Actual '.github/actions/set-project-version', (Line: 62, Col: 15): Expected format {org}/{repo}[/path]@ref. Actual '.github/actions/setup-build', (Line: 63, Col: 15): Expected format {org}/{repo}[/path]@ref. Actual '.github/actions/bump-version', (Line: 66, Col: 15): Expected format {org}/{repo}[/path]@ref. Actual '.github/actions/publish-maven-artifacts', (Line: 81, Col: 15): Expected format {org}/{repo}[/path]@ref. Actual '.github/actions/setup-build', (Line: 82, Col: 15): Expected format {org}/{repo}[/path]@ref. Actual '.github/actions/publish-maven-artifacts'
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:
Prepare-Release:
runs-on: ubuntu-latest
outputs:
RELEASE_REF: ${{ steps.commit-changes.outputs.RELEASE_REF }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: set release type
shell: bash
id: vars
run: |
type=bugfix
if [[ ${{ inputs.version }} == *0 ]]
then
type=release
fi
echo "type=$type" >> $GITHUB_OUTPUT
- uses: .github/actions/set-project-version
with:
version: ${{ inputs.version }}-SNAPSHOT
- name: Commit changes on ${{ steps.vars.outputs.type }}/${{ inputs.version }} branch
shell: bash
id: commit-changes
run: |
git config user.name "eclipse-edc-bot"
git config user.email "edc-bot@eclipse.org"
RELEASE_REF=${{ steps.vars.outputs.type }}/${{ inputs.version }}
git checkout -B $RELEASE_REF
git add .
git commit --allow-empty -m "Prepare ${{ steps.vars.outputs.type }} ${{ inputs.version }}"
# handle the case in which the branch already exist
git pull --rebase origin $RELEASE_REF || true
git push origin $RELEASE_REF
echo "RELEASE_REF=$RELEASE_REF" >> $GITHUB_OUTPUT
Bump-Main-Version:
if: github.ref_name == 'main'
needs: [ Prepare-Release ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: main
- uses: .github/actions/setup-build
- uses: .github/actions/bump-version
with:
base_version: ${{ inputs.version }}
- uses: .github/actions/publish-maven-artifacts
with:
gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.ORG_GPG_PASSPHRASE }}
username: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }}
password: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }}
Publish-Bugfix-Snapshot:
if: github.ref_name != 'main'
needs: [ Prepare-Release ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ needs.Prepare-Release.outputs.RELEASE_REF }}
- uses: .github/actions/setup-build
- uses: .github/actions/publish-maven-artifacts
with:
gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.ORG_GPG_PASSPHRASE }}
username: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }}
password: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }}